<?php
/**
 * SQLSRV Extension Stub File.
 *
 * Current through version 3.0.1 (rel March 22, 2012) of Microsoft Drivers for PHP for SQL Server.
 *
 * Documentation taken from {@link http://msdn.microsoft.com/en-us/library/ee229547(v=sql.10).aspx} on Mar 22, 2012.
 * Additional information from using Reflection.
 */

/**
*      Forces <span class="function">{@link sqlsrv_errors()}</span> to return errors only (no warnings)       when passed as a parameter.       
*/
define('SQLSRV_ERR_ERRORS', 0);

/**
*      Forces <span class="function">{@link sqlsrv_errors()}</span> to return warnings only (no errors)       when passed as a parameter.       
*/
define('SQLSRV_ERR_WARNINGS', 1);

/**
*      Forces <span class="function">{@link sqlsrv_errors()}</span> to return both errors and warings       when passed as a parameter (the default behavior).       
*/
define('SQLSRV_ERR_ALL', 2);

/**
*      Turns on logging of all subsystems when passed to       <span class="function">{@link sqlsrv_configure()}</span> as a parameter.       
*/
define('SQLSRV_LOG_SYSTEM_ALL',-1);

/**
*      Turns off logging of all subsystems when passed to       <span class="function">{@link sqlsrv_configure()}</span> as a parameter.       
*/
define('SQLSRV_LOG_SYSTEM_OFF', 0);

/**
*      Turns on logging of initialization activity when passed to       <span class="function">{@link sqlsrv_configure()}</span> as a parameter.       
*/
define('SQLSRV_LOG_SYSTEM_INIT', 1);

/**
*      Turns on logging of connection activity when passed to       <span class="function">{@link sqlsrv_configure()}</span> as a parameter.       
*/
define('SQLSRV_LOG_SYSTEM_CONN', 2);

/**
*      Turns on logging of statement activity when passed to       <span class="function">{@link sqlsrv_configure()}</span> as a parameter.       
*/
define('SQLSRV_LOG_SYSTEM_STMT', 4);

/**
*      Turns on logging of error function activity when passed to       <span class="function">{@link sqlsrv_configure()}</span> as a parameter.       
*/
define('SQLSRV_LOG_SYSTEM_UTIL', 8);

/**
*      Specifies that errors, warnings, and notices will be logged       when passed to <span class="function">{@link sqlsrv_configure()}</span> as a parameter.       
*/
define('SQLSRV_LOG_SEVERITY_ALL', -1);

/**
*      Specifies that errors will be logged when passed to       <span class="function">{@link sqlsrv_configure()}</span> as a parameter.       
*/
define('SQLSRV_LOG_SEVERITY_ERROR', 1);

/**
*      Specifies that notices will be logged when passed to       <span class="function">{@link sqlsrv_configure()}</span> as a parameter.       
*/
define('SQLSRV_LOG_SEVERITY_NOTICE', 4);

/**
*      Specifies that warnings will be logged when passed to       <span class="function">{@link sqlsrv_configure()}</span> as a parameter.       
*/
define('SQLSRV_LOG_SEVERITY_WARNING', 2);

/**
*      Forces <span class="function">{@link sqlsrv_fetch_array()}</span> to return an array with       numeric when passed as a parameter.       
*/
define('SQLSRV_FETCH_NUMERIC', 1);

/**
*      Forces <span class="function">{@link sqlsrv_fetch_array()}</span> to return an associative       array when passed as a parameter.       
*/
define('SQLSRV_FETCH_ASSOC', 2);

/**
*      Forces <span class="function">{@link sqlsrv_fetch_array()}</span> to return an array with both       associative and numeric keys when passed as a parameter (the default behavior).       
*/
define('SQLSRV_FETCH_BOTH', 3);

/**
 * Null
 *
 * <br />Used with {@link sqlsrv_prepare() sqlsrv_prepare},
 * {@link sqlsrv_query() sqlsrv_query}
 * and {@link sqlsrv_get_field() sqlsrv_get_field} to request a field be return as a specific PHP type.<br />
 *
 * Additional Information at {@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}<br />
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 */
define('SQLSRV_PHPTYPE_NULL', 1);

/**
*      Specifies an integer PHP data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc296208.aspx" class="link external">&raquo;&nbsp;How to: Specify PHP Types</a>.      
*/
define('SQLSRV_PHPTYPE_INT', 2);

/**
*      Specifies a float PHP data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc296208.aspx" class="link external">&raquo;&nbsp;How to: Specify PHP Types</a>.      
*/
define('SQLSRV_PHPTYPE_FLOAT', 3);

/**
*      Specifies a datetime PHP data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc296208.aspx" class="link external">&raquo;&nbsp;How to: Specify PHP Types</a>.      
*/
define('SQLSRV_PHPTYPE_DATETIME', 4);

/**
*      Specifies that data is returned as a raw byte stream from the server without       performing encoding or translation. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc296208.aspx" class="link external">&raquo;&nbsp;How to: Specify PHP Types</a>.      
*/
define('SQLSRV_ENC_BINARY', 'binary');

/**
*      Data is returned in 8-bit characters as specified in the code page of the       Windows locale that is set on the system. Any multi-byte characters or characters       that do not map into this code page are substituted with a single byte question       mark (?) character. This is the default encoding. For usage information,       see <a href="http://msdn.microsoft.com/en-us/library/cc296208.aspx" class="link external">&raquo;&nbsp;How to: Specify PHP Types</a>.      
*/
define('SQLSRV_ENC_CHAR','char');

/**
*      Indicates that a column is not nullable.      
*/
define('SQLSRV_NULLABLE_NO', 0);

/**
*      Indicates that a column is nullable.      
*/
define('SQLSRV_NULLABLE_YES', 1);

/**
*      Indicates that it is not known if a column is nullable.      
*/
define('SQLSRV_NULLABLE_UNKNOWN', 2);

/**
*      Describes the bigint SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_BIGINT', -5);
/**
*      Describes the bit SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_BIT', -7);
/**
*      Describes the datetime SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_DATETIME', 25177693);
/**
*      Describes the float SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_FLOAT', 6);
/**
*      Describes the image SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_IMAGE', -4);
/**
*      Describes the int SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_INT', 4);
/**
*      Describes the money SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_MONEY', 33564163);
/**
*      Describes the ntext SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_NTEXT', -10);
/**
*      Describes the text SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_TEXT', -1);
/**
*      Describes the real SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_REAL', 7);
/**
*      Describes the smalldatetime SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_SMALLDATETIME', 8285);
/**
*      Describes the smallint SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_SMALLINT', 5);
/**
*      Describes the smallmoney SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_SMALLMONEY', 33559555);
/**
*      Describes the timestamp SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_TIMESTAMP', 4606);
/**
*      Describes the tinyint SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_TINYINT', -6);
/**
*      Describes the UDT SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_UDT', -151);
/**
*      Describes the uniqueidentifier SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_UNIQUEIDENTIFIER', -11);
/**
*      Describes the XML SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_XML', -152);
/**
*      Describes the date SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_DATE', 5211);
/**
*      Describes the time SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_TIME', 58728806);
/**
*      Describes the datetimeoffset SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_DATETIMEOFFSET', 58738021);
/**
*      Describes the datetime2 SQL Server data type. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/cc626305.aspx" class="link external">&raquo;&nbsp;How to: Specify SQL Types</a>.      
*/
define('SQLSRV_SQLTYPE_DATETIME2', 58734173);

/**
*      Indicates an input parameter when passed to <span class="function">{@link sqlsrv_query()}</span>       or <span class="function">{@link sqlsrv_prepare()}</span>.      
*/
define('SQLSRV_PARAM_IN', 1);

/**
*      Indicates a bidirectional parameter when passed to <span class="function">{@link sqlsrv_query()}</span>       or <span class="function">{@link sqlsrv_prepare()}</span>.      
*/
define('SQLSRV_PARAM_INOUT', 2);

/**
*      Indicates an output parameter when passed to <span class="function">{@link sqlsrv_query()}</span> or       <span class="function">{@link sqlsrv_prepare()}</span>.      
*/
define('SQLSRV_PARAM_OUT', 4);

/**
*      Inidicates a transaction isolation level of READ UNCOMMITTED. This value is       used to set the TransactionIsolation level in the $connectionOptions arrary       passed to <span class="function">{@link sqlsrv_connect()}</span>.      
*/
define('SQLSRV_TXN_READ_UNCOMMITTED', 1);
/**
*      Inidicates a transaction isolation level of READ COMMITTED. This value is       used to set the TransactionIsolation level in the $connectionOptions arrary       passed to <span class="function">{@link sqlsrv_connect()}</span>.      
*/
define('SQLSRV_TXN_READ_COMMITTED', 2);
/**
*      Inidicates a transaction isolation level of REPEATABLE READ. This value is       used to set the TransactionIsolation level in the $connectionOptions arrary       passed to <span class="function">{@link sqlsrv_connect()}</span>.      
*/
define('SQLSRV_TXN_REPEATABLE_READ', 4);
/**
 * Serializable.
 *
 * <br />Specifies the following:
 * <ul><li>Statements cannot read data that has been modified but not yet committed by other transactions.</li>
 * <li>No other transactions can modify data that has been read by the current transaction until the current
 * transaction completes.</li>
 * <li>Other transactions cannot insert new rows with key values that would fall in the range of keys read by any
 * statements in the current transaction until the current transaction completes.</li></ul>
 *
 * Range locks are placed in the range of key values that match the search conditions of each statement executed in a
 * transaction. This blocks other transactions from updating or inserting any rows that would qualify for any of the
 * statements executed by the current transaction. This means that if any of the statements in a transaction are
 * executed a second time, they will read the same set of rows. The range locks are held until the transaction completes.
 * This is the most restrictive of the isolation levels because it locks entire ranges of keys and holds the locks until
 * the transaction completes. Because concurrency is lower, use this option only when necessary. This option has the same
 * effect as setting HOLDLOCK on all tables in all SELECT statements in a transaction.<br />
 *
 * Used with the TransactionIsolation key when calling {@link sqlsrv_connect() sqlsrv_connect}. For information on using
 * these constants, see {@link http://msdn.microsoft.com/en-us/library/ms173763(v=sql.110).aspx SET TRANSACTION ISOLATION LEVEL (Transact-SQL)}.<br />
 *
 * Additional Information at {@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}<br />
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 */
define('SQLSRV_TXN_SERIALIZABLE', 8);
/**
*      Inidicates a transaction isolation level of SNAPSHOT. This value is used to       set the TransactionIsolation level in the $connectionOptions arrary passed       to <span class="function">{@link sqlsrv_connect()}</span>.      
*/
define('SQLSRV_TXN_SNAPSHOT', 32);

/**
*      Specifies which row to select in a result set. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>.      
*/
define('SQLSRV_SCROLL_NEXT', 1);
/**
*      Specifies which row to select in a result set. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>.      
*/
define('SQLSRV_SCROLL_PRIOR', 4);
/**
*      Specifies which row to select in a result set. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>.      
*/
define('SQLSRV_SCROLL_FIRST', 2);
/**
*      Specifies which row to select in a result set. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>.      
*/
define('SQLSRV_SCROLL_LAST', 3);
/**
*      Specifies which row to select in a result set. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>.      
*/
define('SQLSRV_SCROLL_ABSOLUTE', 5);
/**
*      Specifies which row to select in a result set. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>.      
*/
define('SQLSRV_SCROLL_RELATIVE', 6);

/**
*      Inidicates a forward-only cursor. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>.      
*/
define('SQLSRV_CURSOR_FORWARD', 'forward');
/**
*      Inidicates a static cursor. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>.      
*/
define('SQLSRV_CURSOR_STATIC', 'static');
/**
*      Inidicates a dynamic cursor. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>.      
*/
define('SQLSRV_CURSOR_DYNAMIC', 'dynamic');
/**
*      Inidicates a keyset cursor. For usage information, see       <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>.      
*/
define('SQLSRV_CURSOR_KEYSET', 'keyset');
/**
 * Lets you access rows in any order.
 *
 * <br />Creates a client-side cursor query.<br />
 *
 * Used when calling {@link sqlsrv_query() sqlsrv_query} or
 *{@link sqlsrv_prepare() sqlsrv_prepare} to specify the kind of cursor that you can use in a result
 * set. For information on using these constants, see
 * {@link http://msdn.microsoft.com/en-us/library/ee376927.aspx Specifying a Cursor Type and Selecting Rows}.<br />
 *
 * Additional Information at {@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}<br />
 *
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 */
define('SQLSRV_CURSOR_CLIENT_BUFFERED', 'buffered');


/**
*<div id="function.sqlsrv-connect" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_connect</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_connect</span> &mdash; <span class="dc-title">Opens a connection to a Microsoft SQL Server database</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-connect-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">resource</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_connect</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">string</span> <span class="parameter" style="color:#2EACF9">$serverName</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">array</span> <span class="parameter" style="color:#2EACF9">$connectionInfo</span></span>   ] )</div>    <p class="para rdfs-comment">    Opens a connection to a Microsoft SQL Server database. By default, the connection     is attempted using Windows Authentication. To connect using SQL Server     Authentication, include &quot;UID&quot; and &quot;PWD&quot; in the connection options array.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-connect-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">serverName</span></dt>       <dd>        <p class="para">        The name of the server to which a connection is established. To connect         to a specific instance, follow the server name with a backward slash         and the instance name (e.g. serverName\sqlexpress).       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">connectionInfo</span></dt>       <dd>        <p class="para">        An associative array that specifies options for connecting to the server.         If values for the UID and PWD keys are not specified, the connection         will be attempted using Windows Authentication. For a complete list of supported         keys, see <a href="http://msdn.microsoft.com/en-us/library/ff628167.aspx" class="link external">&raquo;&nbsp;SQLSRV Connection Options</a>.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-connect-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    A connection resource. If a connection cannot be successfully opened, <strong><span>FALSE</span></strong> is returned.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-connect-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2567">     <p><strong>Example #1 Connect using Windows Authentication.</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\\sqlexpress"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//serverName\instanceName<br /><br />//&nbsp;Since&nbsp;UID&nbsp;and&nbsp;PWD&nbsp;are&nbsp;not&nbsp;specified&nbsp;in&nbsp;the&nbsp;$connectionInfo&nbsp;array,<br />//&nbsp;The&nbsp;connection&nbsp;will&nbsp;be&nbsp;attempted&nbsp;using&nbsp;Windows&nbsp;Authentication.<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br /><br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Connection&nbsp;established.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}else{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Connection&nbsp;could&nbsp;not&nbsp;be&nbsp;established.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>   <p class="para">    <div class="example" id="example-2568">     <p><strong>Example #2 Connect by specifying a user name and password.</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\\sqlexpress"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//serverName\instanceName<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"userName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br /><br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Connection&nbsp;established.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}else{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Connection&nbsp;could&nbsp;not&nbsp;be&nbsp;established.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </p>   <p class="para">    <div class="example" id="example-2569">     <p><strong>Example #3 Connect on a specifed port.</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\\sqlexpress,&nbsp;1542"</span><span style="color: #007700">;&nbsp;</span><span style="color: #FF8000">//serverName\instanceName,&nbsp;portNumber&nbsp;(default&nbsp;is&nbsp;1433)<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"userName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br /><br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Connection&nbsp;established.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}else{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Connection&nbsp;could&nbsp;not&nbsp;be&nbsp;established.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </p>  </div>    <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 notes" id="refsect1-function.sqlsrv-connect-notes">   <h3 class="title">注释</h3>   <p class="para">    By default, the <span class="function"><strong style="color:#CC7832">sqlsrv_connect()</strong></span> uses connection pooling to     improve connection performance. To turn off connection pooling (i.e. force a     new connection on each call), set the &quot;ConnectionPooling&quot; option in the     $connectionOptions array to 0 (or <strong><span>FALSE</span></strong>). For more information, see     <a href="http://msdn.microsoft.com/en-us/library/cc644930.aspx" class="link external">&raquo;&nbsp;SQLSRV Connection Pooling</a>.   </p>   <p class="para">   The SQLSRV extension does not have a dedicated function for changing which    database is connected to. The target database is specified in the    $connectionOptions array that is passed to sqlsrv_connect. To change the    database on an open connection, execute the following query &quot;USE dbName&quot;    (e.g. sqlsrv_query($conn, &quot;USE dbName&quot;)).   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-connect-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_close()} - Closes an open connection and releases resourses associated with the connection</span></li>     <li class="member"><span class="function">{@link sqlsrv_errors()} - Returns error and warning information about the last SQLSRV operation performed</span></li>     <li class="member"><span class="function">{@link sqlsrv_query()} - Prepares and executes a query</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return resource|false A PHP connection resource. If a connection cannot be successfully created and opened, false is returned.*/
function sqlsrv_connect($server_name, $connection_info = array()){}

/**
*<div id="function.sqlsrv-close" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_close</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_close</span> &mdash; <span class="dc-title">Closes an open connection and releases resourses associated with the connection</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-close-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">bool</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_close</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$conn</span></span>    )</div>    <p class="para rdfs-comment">    Closes an open connection and releases resourses associated with the connection.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-close-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">conn</span></dt>       <dd>        <p class="para">        The connection to be closed.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-close-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    成功时返回 <strong><span>TRUE</span></strong>， 或者在失败时返回 <strong><span>FALSE</span></strong>。   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-close-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2565">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_close()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpres"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connOptions&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbname"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connOptions&nbsp;</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//-------------------------------------<br />//&nbsp;Perform&nbsp;database&nbsp;operations&nbsp;here.<br />//-------------------------------------<br /><br />//&nbsp;Close&nbsp;the&nbsp;connection.<br /></span><span style="color: #9876AA">sqlsrv_close</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-close-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_connect()} - Opens a connection to a Microsoft SQL Server database</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return bool The Boolean value true unless the function is called with an invalid parameter. If the function is called with an invalid parameter, false is returned.*/
function sqlsrv_close($conn){}

/**
*<div id="function.sqlsrv-commit" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_commit</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_commit</span> &mdash; <span class="dc-title">Commits a transaction that was begun with <span class="function">{@link sqlsrv_begin_transaction()}</span></span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-commit-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">bool</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_commit</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$conn</span></span>    )</div>    <p class="para rdfs-comment">    Commits a transaction that was begun with <span class="function">{@link sqlsrv_begin_transaction()}</span>.     The connection is returned to auto-commit mode after <span class="function"><strong style="color:#CC7832">sqlsrv_commit()</strong></span>     is called. The transaction that is committed includes all statements that were     executed after the call to <span class="function">{@link sqlsrv_begin_transaction()}</span>.     Explicit transactions should be started and committed or rolled back using these     functions instead of executing SQL statements that begin and committ/roll back     transactions. For more information, see     <a href="http://msdn.microsoft.com/en-us/library/cc296206.aspx" class="link external">&raquo;&nbsp;SQLSRV Transactions</a>.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-commit-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">conn</span></dt>       <dd>        <p class="para">        The connection on which the transaction is to be committed.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-commit-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    成功时返回 <strong><span>TRUE</span></strong>， 或者在失败时返回 <strong><span>FALSE</span></strong>。   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-commit-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2566">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_commit()</strong></span> example</strong></p>     <div class="example-contents"><p>     The following example demonstrates how to use <span class="function"><strong style="color:#CC7832">sqlsrv_commit()</strong></span>      together with <span class="function">{@link sqlsrv_begin_transaction()}</span> and      <span class="function">{@link sqlsrv_rollback()}</span>.     </p></div>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"userName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true&nbsp;</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Begin&nbsp;the&nbsp;transaction.&nbsp;<br /></span><span style="color: #007700">if&nbsp;(&nbsp;</span><span style="color: #9876AA">sqlsrv_begin_transaction</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true&nbsp;</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Initialize&nbsp;parameter&nbsp;values.&nbsp;<br /></span><span style="color: #9876AA">$orderId&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">1</span><span style="color: #007700">;&nbsp;</span><span style="color: #9876AA">$qty&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">10</span><span style="color: #007700">;&nbsp;</span><span style="color: #9876AA">$productId&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">100</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;Set&nbsp;up&nbsp;and&nbsp;execute&nbsp;the&nbsp;first&nbsp;query.&nbsp;<br /></span><span style="color: #9876AA">$sql1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"INSERT&nbsp;INTO&nbsp;OrdersTable&nbsp;(ID,&nbsp;Quantity,&nbsp;ProductID)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VALUES&nbsp;(?,&nbsp;?,&nbsp;?)"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$params1&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #9876AA">$orderId</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$qty</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$productId&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$stmt1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql1</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$params1&nbsp;</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Set&nbsp;up&nbsp;and&nbsp;execute&nbsp;the&nbsp;second&nbsp;query.&nbsp;<br /></span><span style="color: #9876AA">$sql2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"UPDATE&nbsp;InventoryTable&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SET&nbsp;Quantity&nbsp;=&nbsp;(Quantity&nbsp;-&nbsp;?)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE&nbsp;ProductID&nbsp;=&nbsp;?"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$params2&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #9876AA">$qty</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$productId</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$stmt2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql2</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$params2&nbsp;</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;If&nbsp;both&nbsp;queries&nbsp;were&nbsp;successful,&nbsp;commit&nbsp;the&nbsp;transaction.&nbsp;<br />//&nbsp;Otherwise,&nbsp;rollback&nbsp;the&nbsp;transaction.&nbsp;<br /></span><span style="color: #007700">if(&nbsp;</span><span style="color: #9876AA">$stmt1&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #9876AA">$stmt2&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #9876AA">sqlsrv_commit</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Transaction&nbsp;committed.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #9876AA">sqlsrv_rollback</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Transaction&nbsp;rolled&nbsp;back.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-commit-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_begin_transaction()} - Begins a database transaction</span></li>     <li class="member"><span class="function">{@link sqlsrv_rollback()} - Rolls back a transaction that was begun with    sqlsrv_begin_transaction</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return bool A Boolean value: true if the transaction was successfully committed. Otherwise, false.*/
function sqlsrv_commit($conn){}

/**
*<div id="function.sqlsrv-begin-transaction" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_begin_transaction</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_begin_transaction</span> &mdash; <span class="dc-title">Begins a database transaction</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-begin-transaction-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">bool</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_begin_transaction</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$conn</span></span>    )</div>    <p class="para rdfs-comment">    The transaction begun by <span class="function"><strong style="color:#CC7832">sqlsrv_begin_transaction()</strong></span> includes     all statements that were executed after the call to     <span class="function"><strong style="color:#CC7832">sqlsrv_begin_transaction()</strong></span> and before calls to     <span class="function">{@link sqlsrv_rollback()}</span> or <span class="function">{@link sqlsrv_commit()}</span>.     Explicit transactions should be started and committed or rolled back using     these functions instead of executing SQL statements that begin and committ/roll     back transactions. For more information, see     <a href="http://msdn.microsoft.com/en-us/library/cc296206.aspx" class="link external">&raquo;&nbsp;SQLSRV Transactions</a>.   </p>  </div>   <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-begin-transaction-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">conn</span></dt>       <dd>        <p class="para">        The connection resource returned by a call to <span class="function">{@link sqlsrv_connect()}</span>.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-begin-transaction-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    成功时返回 <strong><span>TRUE</span></strong>， 或者在失败时返回 <strong><span>FALSE</span></strong>。   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-begin-transaction-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="sqlite3.enableexceptions.example.basic">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_begin_transaction()</strong></span> example</strong></p>     <div class="example-contents"><p>     The following example demonstrates how to use      <span class="function"><strong style="color:#CC7832">sqlsrv_begin_transaction()</strong></span> together with      <span class="function">{@link sqlsrv_commit()}</span> and <span class="function">{@link sqlsrv_rollback()}</span>.     </p></div>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"userName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true&nbsp;</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Begin&nbsp;the&nbsp;transaction.&nbsp;<br /></span><span style="color: #007700">if&nbsp;(&nbsp;</span><span style="color: #9876AA">sqlsrv_begin_transaction</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true&nbsp;</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Initialize&nbsp;parameter&nbsp;values.&nbsp;<br /></span><span style="color: #9876AA">$orderId&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">1</span><span style="color: #007700">;&nbsp;</span><span style="color: #9876AA">$qty&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">10</span><span style="color: #007700">;&nbsp;</span><span style="color: #9876AA">$productId&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">100</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;Set&nbsp;up&nbsp;and&nbsp;execute&nbsp;the&nbsp;first&nbsp;query.&nbsp;<br /></span><span style="color: #9876AA">$sql1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"INSERT&nbsp;INTO&nbsp;OrdersTable&nbsp;(ID,&nbsp;Quantity,&nbsp;ProductID)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VALUES&nbsp;(?,&nbsp;?,&nbsp;?)"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$params1&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #9876AA">$orderId</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$qty</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$productId&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$stmt1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql1</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$params1&nbsp;</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Set&nbsp;up&nbsp;and&nbsp;execute&nbsp;the&nbsp;second&nbsp;query.&nbsp;<br /></span><span style="color: #9876AA">$sql2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"UPDATE&nbsp;InventoryTable&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SET&nbsp;Quantity&nbsp;=&nbsp;(Quantity&nbsp;-&nbsp;?)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE&nbsp;ProductID&nbsp;=&nbsp;?"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$params2&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #9876AA">$qty</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$productId</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$stmt2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql2</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$params2&nbsp;</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;If&nbsp;both&nbsp;queries&nbsp;were&nbsp;successful,&nbsp;commit&nbsp;the&nbsp;transaction.&nbsp;<br />//&nbsp;Otherwise,&nbsp;rollback&nbsp;the&nbsp;transaction.&nbsp;<br /></span><span style="color: #007700">if(&nbsp;</span><span style="color: #9876AA">$stmt1&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #9876AA">$stmt2&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #9876AA">sqlsrv_commit</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Transaction&nbsp;committed.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #9876AA">sqlsrv_rollback</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Transaction&nbsp;rolled&nbsp;back.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>      <div class="example-contents"><p>以上例程的输出类似于：</p></div>    </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-begin-transaction-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_commit()} - Commits a transaction that was begun with sqlsrv_begin_transaction</span></li>     <li class="member"><span class="function">{@link sqlsrv_rollback()} - Rolls back a transaction that was begun with    sqlsrv_begin_transaction</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return bool A Boolean value: true if the transaction was successfully begun. Otherwise, false.*/
function sqlsrv_begin_transaction($conn){}

/**
*<div id="function.sqlsrv-rollback" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_rollback</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_rollback</span> &mdash; <span class="dc-title">Rolls back a transaction that was begun with    <span class="function">{@link sqlsrv_begin_transaction()}</span></span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-rollback-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">bool</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_rollback</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$conn</span></span>    )</div>    <p class="para rdfs-comment">    Rolls back a transaction that was begun with <span class="function">{@link sqlsrv_begin_transaction()}</span>     and returns the connection to auto-commit mode.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-rollback-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">conn</span></dt>       <dd>        <p class="para">        The connection resource returned by a call to <span class="function">{@link sqlsrv_connect()}</span>.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-rollback-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    成功时返回 <strong><span>TRUE</span></strong>， 或者在失败时返回 <strong><span>FALSE</span></strong>。   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-rollback-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2585">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_rollback()</strong></span> example</strong></p>     <div class="example-contents"><p>     The following example demonstrates how to use <span class="function">{@link sqlsrv_begin_transaction()}</span>      together with <span class="function">{@link sqlsrv_commit()}</span> and <span class="function"><strong style="color:#CC7832">sqlsrv_rollback()</strong></span>.     </p></div>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"userName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true&nbsp;</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Begin&nbsp;the&nbsp;transaction.&nbsp;<br /></span><span style="color: #007700">if&nbsp;(&nbsp;</span><span style="color: #9876AA">sqlsrv_begin_transaction</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true&nbsp;</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Initialize&nbsp;parameter&nbsp;values.&nbsp;<br /></span><span style="color: #9876AA">$orderId&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">1</span><span style="color: #007700">;&nbsp;</span><span style="color: #9876AA">$qty&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">10</span><span style="color: #007700">;&nbsp;</span><span style="color: #9876AA">$productId&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">100</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;Set&nbsp;up&nbsp;and&nbsp;execute&nbsp;the&nbsp;first&nbsp;query.&nbsp;<br /></span><span style="color: #9876AA">$sql1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"INSERT&nbsp;INTO&nbsp;OrdersTable&nbsp;(ID,&nbsp;Quantity,&nbsp;ProductID)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;VALUES&nbsp;(?,&nbsp;?,&nbsp;?)"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$params1&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #9876AA">$orderId</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$qty</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$productId&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$stmt1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql1</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$params1&nbsp;</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Set&nbsp;up&nbsp;and&nbsp;execute&nbsp;the&nbsp;second&nbsp;query.&nbsp;<br /></span><span style="color: #9876AA">$sql2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"UPDATE&nbsp;InventoryTable&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SET&nbsp;Quantity&nbsp;=&nbsp;(Quantity&nbsp;-&nbsp;?)&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE&nbsp;ProductID&nbsp;=&nbsp;?"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$params2&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #9876AA">$qty</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$productId</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$stmt2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql2</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$params2&nbsp;</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;If&nbsp;both&nbsp;queries&nbsp;were&nbsp;successful,&nbsp;commit&nbsp;the&nbsp;transaction.&nbsp;<br />//&nbsp;Otherwise,&nbsp;rollback&nbsp;the&nbsp;transaction.&nbsp;<br /></span><span style="color: #007700">if(&nbsp;</span><span style="color: #9876AA">$stmt1&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #9876AA">$stmt2&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #9876AA">sqlsrv_commit</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Transaction&nbsp;committed.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #9876AA">sqlsrv_rollback</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Transaction&nbsp;rolled&nbsp;back.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-rollback-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_begin_transaction()} - Begins a database transaction</span></li>     <li class="member"><span class="function">{@link sqlsrv_commit()} - Commits a transaction that was begun with sqlsrv_begin_transaction</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return bool A Boolean value: true if the transaction was successfully rolled back. Otherwise, false.*/
function sqlsrv_rollback($conn){}

/**
*<div id="function.sqlsrv-errors" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_errors</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_errors</span> &mdash; <span class="dc-title">Returns error and warning information about the last SQLSRV operation performed</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-errors-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">        <span class="type" style="color:#EAB766"><a href="http://php.net/manual/zh/language.pseudo-types.php#language.types.mixed" class="type mixed" style="color:#EAB766">mixed</a></span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_errors</strong></span>     ([ <span class="methodparam"><span class="type" style="color:#EAB766">int</span> <span class="parameter" style="color:#2EACF9">$errorsOrWarnings</span></span>   ] )</div>    <p class="para rdfs-comment">    Returns error and warning information about the last SQLSRV operation performed.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-errors-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">errorsOrWarnings</span></dt>       <dd>        <p class="para">        Determines whether error information, warning information, or both are         returned. If this parameter is not supplied, both error information and         warning information are returned. The following are the supported values         for this parameter: SQLSRV_ERR_ALL, SQLSRV_ERR_ERRORS, SQLSRV_ERR_WARNINGS.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-errors-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    If errors and/or warnings occurred on the last sqlsrv operation, an array of     arrays containing error information is returned. If no errors and/or warnings     occurred on the last sqlsrv operation, <strong><span>NULL</span></strong> is returned. The following table     describes the structure of the returned arrays:    <table class="doctable table">    <caption><strong>Array returned by sqlsrv_errors</strong></caption>         <thead>      <tr>       <th>Key</th>       <th>Description</th>      </tr>      </thead>      <tbody class="tbody">      <tr>       <td>SQLSTATE</td>       <td>For errors that originate from the ODBC driver, the SQLSTATE returned        by ODBC. For errors that originate from the Microsoft Drivers for PHP for        SQL Server, a SQLSTATE of IMSSP. For warnings that originate from the        Microsoft Drivers for PHP for SQL Server, a SQLSTATE of 01SSP.       </td>      </tr>       <tr>       <td>code</td>       <td>For errors that originate from SQL Server, the native SQL Server        error code. For errors that originate from the ODBC driver, the error        code returned by ODBC. For errors that originate from the Microsoft Drivers        for PHP for SQL Server, the Microsoft Drivers for PHP for SQL Server error code.       </td>      </tr>       <tr>       <td>message</td>       <td>A description of the error.</td>      </tr>      </tbody>       </table>    </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-errors-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2570">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">functionname()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName/sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Set&nbsp;up&nbsp;a&nbsp;query&nbsp;to&nbsp;select&nbsp;an&nbsp;invalid&nbsp;column&nbsp;name.&nbsp;<br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;BadColumnName&nbsp;FROM&nbsp;Table_1"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;Execution&nbsp;of&nbsp;the&nbsp;query&nbsp;will&nbsp;fail&nbsp;because&nbsp;of&nbsp;the&nbsp;bad&nbsp;column&nbsp;name.&nbsp;<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(&nbsp;(</span><span style="color: #9876AA">$errors&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">()&nbsp;)&nbsp;!=&nbsp;</span><span style="color: #9876AA">null</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach(&nbsp;</span><span style="color: #9876AA">$errors&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #9876AA">$error&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"SQLSTATE:&nbsp;"</span><span style="color: #007700">.</span><span style="color: #9876AA">$error</span><span style="color: #007700">[&nbsp;</span><span style="color: #DD0000">'SQLSTATE'</span><span style="color: #007700">].</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"code:&nbsp;"</span><span style="color: #007700">.</span><span style="color: #9876AA">$error</span><span style="color: #007700">[&nbsp;</span><span style="color: #DD0000">'code'</span><span style="color: #007700">].</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"message:&nbsp;"</span><span style="color: #007700">.</span><span style="color: #9876AA">$error</span><span style="color: #007700">[&nbsp;</span><span style="color: #DD0000">'message'</span><span style="color: #007700">].</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>    <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 notes" id="refsect1-function.sqlsrv-errors-notes">   <h3 class="title">注释</h3>   <p class="para">    By default, warnings generated on a call to any SQLSRV function are treated     as errors. This means that if a warning occurs on a call to a SQLSRV function,     the function returns <strong><span>FALSE</span></strong>. However, warnings that correspond to SQLSTATE     values 01000, 01001, 01003, and 01S02 are never treated as errors. For     information about changing this behavior, see <span class="function">{@link sqlsrv_configure()}</span>     and the WarningsReturnAsErrors setting.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-errors-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_configure()} - Changes the driver error handling and logging configurations</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return array|null An array of arrays, or null. Each array in the returned array contains three key-value pairs. The*/
function sqlsrv_errors($errorsAndOrWarnings = SQLSRV_ERR_ALL){}

/**
*<div id="function.sqlsrv-configure" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_configure</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_configure</span> &mdash; <span class="dc-title">Changes the driver error handling and logging configurations</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-configure-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">bool</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_configure</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">string</span> <span class="parameter" style="color:#2EACF9">$setting</span></span>    , <span class="methodparam"><span class="type" style="color:#EAB766"><a href="http://php.net/manual/zh/language.pseudo-types.php#language.types.mixed" class="type mixed" style="color:#EAB766">mixed</a></span> <span class="parameter" style="color:#2EACF9">$value</span></span>    )</div>    <p class="para rdfs-comment">    Changes the driver error handling and logging configurations.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-configure-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">setting</span></dt>       <dd>        <p class="para">        The name of the setting to set. The possible values are         &quot;WarningsReturnAsErrors&quot;, &quot;LogSubsystems&quot;, and &quot;LogSeverity&quot;.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">value</span></dt>       <dd>        <p class="para">        The value of the specified setting. The following table shows possible values:           <table class="doctable table">    <caption><strong>Error and Logging Setting Options</strong></caption>         <thead>      <tr>       <th>Setting</th>       <th>Options</th>      </tr>      </thead>      <tbody class="tbody">      <tr>       <td>WarningsReturnAsErrors</td>       <td>1 (<strong><span>TRUE</span></strong>) or 0 (<strong><span>FALSE</span></strong>)</td>      </tr>       <tr>       <td>LogSubsystems</td>       <td>SQLSRV_LOG_SYSTEM_ALL (-1)        SQLSRV_LOG_SYSTEM_CONN (2)        SQLSRV_LOG_SYSTEM_INIT (1)        SQLSRV_LOG_SYSTEM_OFF (0)        SQLSRV_LOG_SYSTEM_STMT (4)        SQLSRV_LOG_SYSTEM_UTIL (8)</td>      </tr>       <tr>       <td>LogSeverity</td>       <td>SQLSRV_LOG_SEVERITY_ALL (-1)        SQLSRV_LOG_SEVERITY_ERROR (1)        SQLSRV_LOG_SEVERITY_NOTICE (4)        SQLSRV_LOG_SEVERITY_WARNING (2)</td>      </tr>      </tbody>       </table>        </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-configure-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    成功时返回 <strong><span>TRUE</span></strong>， 或者在失败时返回 <strong><span>FALSE</span></strong>。   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-configure-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><a href="http://msdn.microsoft.com/en-us/library/cc626302.aspx" class="link external">&raquo;&nbsp;SQLSRV Error Handling</a>.</li>     <li class="member"><a href="http://msdn.microsoft.com/en-us/library/cc296188.aspx" class="link external">&raquo;&nbsp;Logging SQLSRV Activity</a>.</li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return bool If sqlsrv_configure is called with an unsupported setting or value, the function returns false. Otherwise, the function returns true.*/
function sqlsrv_configure($setting, $value){}

/**
*<div id="function.sqlsrv-get-config" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_get_config</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_get_config</span> &mdash; <span class="dc-title">Returns the value of the specified configuration setting</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-get-config-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766"><a href="http://php.net/manual/zh/language.pseudo-types.php#language.types.mixed" class="type mixed" style="color:#EAB766">mixed</a></span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_get_config</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">string</span> <span class="parameter" style="color:#2EACF9">$setting</span></span>    )</div>    <p class="para rdfs-comment">    Returns the value of the specified configuration setting.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-get-config-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">setting</span></dt>       <dd>        <p class="para">        The name of the setting for which the value is returned. For a list of         configurable settings, see <span class="function">{@link sqlsrv_configure()}</span>.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-get-config-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns the value of the specified setting. If an invalid setting is specified,     <strong><span>FALSE</span></strong> is returned.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-get-config-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_configure()} - Changes the driver error handling and logging configurations</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return mixed The value of the setting specified by the $setting parameter. If an invalid setting is specified, false is returned and an error is added to the error collection.*/
function sqlsrv_get_config($setting){}

/**
*<div id="function.sqlsrv-prepare" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_prepare</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_prepare</span> &mdash; <span class="dc-title">Prepares a query for execution</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-prepare-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766"><a href="http://php.net/manual/zh/language.pseudo-types.php#language.types.mixed" class="type mixed" style="color:#EAB766">mixed</a></span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_prepare</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$conn</span></span>    , <span class="methodparam"><span class="type" style="color:#EAB766">string</span> <span class="parameter" style="color:#2EACF9">$sql</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">array</span> <span class="parameter" style="color:#2EACF9">$params</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">array</span> <span class="parameter" style="color:#2EACF9">$options</span></span>   ]] )</div>    <p class="para rdfs-comment">    Prepares a query for execution. This function is ideal for preparing a query     that will be executed multiple times with different parameter values.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-prepare-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">conn</span></dt>       <dd>        <p class="para">        A connection resource returned by <span class="function">{@link sqlsrv_connect()}</span>.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">sql</span></dt>       <dd>        <p class="para">        The string that defines the query to be prepared and executed.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">params</span></dt>       <dd>        <p class="para">        An array specifying parameter information when executing a parameterized         query. Array elements can be any of the following:        <ul class="simplelist">         <li class="member">A literal value</li>         <li class="member">A PHP variable</li>         <li class="member">An array with this structure:          array($value [, $direction [, $phpType [, $sqlType]]])</li>        </ul>        The following table describes the elements in the array structure above:        </p>        <table class="doctable table">        <caption><strong>Array structure</strong></caption>                 <thead>          <tr>           <th>Element</th>           <th>Description</th>          </tr>          </thead>          <tbody class="tbody">          <tr>           <td>$value</td>           <td>A literal value, a PHP variable, or a PHP by-reference variable.</td>          </tr>           <tr>           <td>$direction (optional)</td>           <td>One of the following SQLSRV constants used to indicate the            parameter direction: SQLSRV_PARAM_IN, SQLSRV_PARAM_OUT, SQLSRV_PARAM_INOUT.            The default value is SQLSRV_PARAM_IN.         </td>          </tr>           <tr>           <td>$phpType (optional)</td>           <td>A SQLSRV_PHPTYPE_* constant that specifies PHP data type of the            returned value.</td>          </tr>           <tr>           <td>$sqlType (optional)</td>           <td>A SQLSRV_SQLTYPE_* constant that specifies the SQL Server data            type of the input value.</td>          </tr>          </tbody>               </table>       </dd>                 <dt> <span class="parameter" style="color:#2EACF9">options</span></dt>       <dd>        <p class="para">        An array specifing query property options. The supported keys are described         in the following table:       </p>       <table class="doctable table">        <caption><strong>Query Options</strong></caption>                 <thead>          <tr>           <th>Key</th>           <th>Values</th>           <th>Description</th>          </tr>          </thead>          <tbody class="tbody">          <tr>           <td>QueryTimeout</td>           <td>A positive integer value.</td>           <td>Sets the query timeout in seconds. By default, the driver will            wait indefinitely for results.</td>          </tr>           <tr>           <td>SendStreamParamsAtExec</td>           <td><strong><span>TRUE</span></strong> or <strong><span>FALSE</span></strong> (the default is <strong><span>TRUE</span></strong>)</td>           <td>Configures the driver to send all stream data at execution (<strong><span>TRUE</span></strong>),            or to send stream data in chunks (<strong><span>FALSE</span></strong>). By default, the value is set to <strong><span>TRUE</span></strong>.            For more information, see <span class="function">{@link sqlsrv_send_stream_data()}</span>.</td>          </tr>           <tr>           <td>Scrollable</td>           <td>SQLSRV_CURSOR_FORWARD, SQLSRV_CURSOR_STATIC, SQLSRV_CURSOR_DYNAMIC,            or SQLSRV_CURSOR_KEYSET</td>           <td>See <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>            in the Microsoft SQLSRV documentation.</td>          </tr>          </tbody>               </table>       </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-prepare-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns a statement resource on success and <strong><span>FALSE</span></strong> if an error occurred.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-prepare-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2583">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_prepare()</strong></span> example</strong></p>     <div class="example-contents"><p>     This example demonstrates how to prepare a statement with <span class="function"><strong style="color:#CC7832">sqlsrv_prepare()</strong></span>      and re-execute it multiple times (with different parameter values) using <span class="function">{@link sqlsrv_execute()}</span>.     </p></div>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"UPDATE&nbsp;Table_1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SET&nbsp;OrderQty&nbsp;=&nbsp;?<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE&nbsp;SalesOrderID&nbsp;=&nbsp;?"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;Initialize&nbsp;parameters&nbsp;and&nbsp;prepare&nbsp;the&nbsp;statement.&nbsp;<br />//&nbsp;Variables&nbsp;$qty&nbsp;and&nbsp;$id&nbsp;are&nbsp;bound&nbsp;to&nbsp;the&nbsp;statement,&nbsp;$stmt.<br /></span><span style="color: #9876AA">$qty&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #9876AA">$id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">0</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_prepare</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql</span><span style="color: #007700">,&nbsp;array(&nbsp;&amp;</span><span style="color: #9876AA">$qty</span><span style="color: #007700">,&nbsp;&amp;</span><span style="color: #9876AA">$id</span><span style="color: #007700">));<br />if(&nbsp;!</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Set&nbsp;up&nbsp;the&nbsp;SalesOrderDetailID&nbsp;and&nbsp;OrderQty&nbsp;information.&nbsp;<br />//&nbsp;This&nbsp;array&nbsp;maps&nbsp;the&nbsp;order&nbsp;ID&nbsp;to&nbsp;order&nbsp;quantity&nbsp;in&nbsp;key=&gt;value&nbsp;pairs.<br /></span><span style="color: #9876AA">$orders&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #9876AA">1</span><span style="color: #007700">=&gt;</span><span style="color: #9876AA">10</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">2</span><span style="color: #007700">=&gt;</span><span style="color: #9876AA">20</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">3</span><span style="color: #007700">=&gt;</span><span style="color: #9876AA">30</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Execute&nbsp;the&nbsp;statement&nbsp;for&nbsp;each&nbsp;order.<br /></span><span style="color: #007700">foreach(&nbsp;</span><span style="color: #9876AA">$orders&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #9876AA">$id&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #9876AA">$qty</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Because&nbsp;$id&nbsp;and&nbsp;$qty&nbsp;are&nbsp;bound&nbsp;to&nbsp;$stmt1,&nbsp;their&nbsp;updated<br />&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;values&nbsp;are&nbsp;used&nbsp;with&nbsp;each&nbsp;execution&nbsp;of&nbsp;the&nbsp;statement.&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(&nbsp;</span><span style="color: #9876AA">sqlsrv_execute</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>    <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 notes" id="refsect1-function.sqlsrv-prepare-notes">   <h3 class="title">注释</h3>   <p class="para">    When you prepare a statement that uses variables as parameters, the variables     are bound to the statement. This means that if you update the values of the     variables, the next time you execute the statement it will run with updated     parameter values. For statements that you plan to execute only once, use     <span class="function">{@link sqlsrv_query()}</span>.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-prepare-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_execute()} - Executes a statement prepared with sqlsrv_prepare</span></li>     <li class="member"><span class="function">{@link sqlsrv_query()} - Prepares and executes a query</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return resource|false A statement resource. If the statement resource cannot be created, false is returned.*/
function sqlsrv_prepare($conn, $tsql, $params=array(), $options=array()){}

/**
*<div id="function.sqlsrv-execute" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_execute</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_execute</span> &mdash; <span class="dc-title">Executes a statement prepared with <span class="function">{@link sqlsrv_prepare()}</span></span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-execute-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">bool</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_execute</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    )</div>    <p class="para rdfs-comment">    Executes a statement prepared with <span class="function">{@link sqlsrv_prepare()}</span>. This     function is ideal for executing a prepared statement multiple times with     different parameter values.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-execute-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        A statement resource returned by <span class="function">{@link sqlsrv_prepare()}</span>.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-execute-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    成功时返回 <strong><span>TRUE</span></strong>， 或者在失败时返回 <strong><span>FALSE</span></strong>。   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-execute-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2571">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_execute()</strong></span> example</strong></p>     <div class="example-contents"><p>     This example demonstrates how to prepare a statement with      <span class="function">{@link sqlsrv_prepare()}</span> and re-execute it multiple times (with      different parameter values) using <span class="function"><strong style="color:#CC7832">sqlsrv_execute()</strong></span>.     </p></div>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"UPDATE&nbsp;Table_1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SET&nbsp;OrderQty&nbsp;=&nbsp;?<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE&nbsp;SalesOrderID&nbsp;=&nbsp;?"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;Initialize&nbsp;parameters&nbsp;and&nbsp;prepare&nbsp;the&nbsp;statement.&nbsp;<br />//&nbsp;Variables&nbsp;$qty&nbsp;and&nbsp;$id&nbsp;are&nbsp;bound&nbsp;to&nbsp;the&nbsp;statement,&nbsp;$stmt.<br /></span><span style="color: #9876AA">$qty&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #9876AA">$id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">0</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_prepare</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql</span><span style="color: #007700">,&nbsp;array(&nbsp;&amp;</span><span style="color: #9876AA">$qty</span><span style="color: #007700">,&nbsp;&amp;</span><span style="color: #9876AA">$id</span><span style="color: #007700">));<br />if(&nbsp;!</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Set&nbsp;up&nbsp;the&nbsp;SalesOrderDetailID&nbsp;and&nbsp;OrderQty&nbsp;information.&nbsp;<br />//&nbsp;This&nbsp;array&nbsp;maps&nbsp;the&nbsp;order&nbsp;ID&nbsp;to&nbsp;order&nbsp;quantity&nbsp;in&nbsp;key=&gt;value&nbsp;pairs.<br /></span><span style="color: #9876AA">$orders&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #9876AA">1</span><span style="color: #007700">=&gt;</span><span style="color: #9876AA">10</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">2</span><span style="color: #007700">=&gt;</span><span style="color: #9876AA">20</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">3</span><span style="color: #007700">=&gt;</span><span style="color: #9876AA">30</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Execute&nbsp;the&nbsp;statement&nbsp;for&nbsp;each&nbsp;order.<br /></span><span style="color: #007700">foreach(&nbsp;</span><span style="color: #9876AA">$orders&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #9876AA">$id&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #9876AA">$qty</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Because&nbsp;$id&nbsp;and&nbsp;$qty&nbsp;are&nbsp;bound&nbsp;to&nbsp;$stmt1,&nbsp;their&nbsp;updated<br />&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;values&nbsp;are&nbsp;used&nbsp;with&nbsp;each&nbsp;execution&nbsp;of&nbsp;the&nbsp;statement.&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(&nbsp;</span><span style="color: #9876AA">sqlsrv_execute</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>    <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 notes" id="refsect1-function.sqlsrv-execute-notes">   <h3 class="title">注释</h3>   <p class="para">    When you prepare a statement that uses variables as parameters, the variables     are bound to the statement. This means that if you update the values of the     variables, the next time you execute the statement it will run with updated     parameter values. For statements that you plan to execute only once, use     <span class="function">{@link sqlsrv_query()}</span>.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-execute-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_prepare()} - Prepares a query for execution</span></li>     <li class="member"><span class="function">{@link sqlsrv_query()} - Prepares and executes a query</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return bool A Boolean value: true if the statement was successfully executed. Otherwise, false.*/
function sqlsrv_execute($stmt){}

/**
*<div id="function.sqlsrv-query" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_query</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_query</span> &mdash; <span class="dc-title">Prepares and executes a query</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-query-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766"><a href="http://php.net/manual/zh/language.pseudo-types.php#language.types.mixed" class="type mixed" style="color:#EAB766">mixed</a></span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_query</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$conn</span></span>    , <span class="methodparam"><span class="type" style="color:#EAB766">string</span> <span class="parameter" style="color:#2EACF9">$sql</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">array</span> <span class="parameter" style="color:#2EACF9">$params</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">array</span> <span class="parameter" style="color:#2EACF9">$options</span></span>   ]] )</div>    <p class="para rdfs-comment">    Prepares and executes a query.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-query-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">conn</span></dt>       <dd>        <p class="para">        A connection resource returned by <span class="function">{@link sqlsrv_connect()}</span>.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">sql</span></dt>       <dd>        <p class="para">        The string that defines the query to be prepared and executed.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">params</span></dt>       <dd>        <p class="para">        An array specifying parameter information when executing a parameterized query.         Array elements can be any of the following:        <ul class="simplelist">         <li class="member">A literal value</li>         <li class="member">A PHP variable</li>         <li class="member">An array with this structure:          array($value [, $direction [, $phpType [, $sqlType]]])</li>        </ul>        The following table describes the elements in the array structure above:        </p>        <table class="doctable table">        <caption><strong>Array structure</strong></caption>                 <thead>          <tr>           <th>Element</th>           <th>Description</th>          </tr>          </thead>          <tbody class="tbody">          <tr>           <td>$value</td>           <td>A literal value, a PHP variable, or a PHP by-reference variable.</td>          </tr>           <tr>           <td>$direction (optional)</td>           <td>One of the following SQLSRV constants used to indicate the            parameter direction: SQLSRV_PARAM_IN, SQLSRV_PARAM_OUT, SQLSRV_PARAM_INOUT.            The default value is SQLSRV_PARAM_IN.</td>          </tr>           <tr>           <td>$phpType (optional)</td>           <td>A SQLSRV_PHPTYPE_* constant that specifies PHP data type of the            returned value.</td>          </tr>           <tr>           <td>$sqlType (optional)</td>           <td>A SQLSRV_SQLTYPE_* constant that specifies the SQL Server data            type of the input value.</td>          </tr>          </tbody>               </table>       </dd>                 <dt> <span class="parameter" style="color:#2EACF9">options</span></dt>       <dd>        <p class="para">        An array specifing query property options. The supported keys are described         in the following table:       </p>       <table class="doctable table">        <caption><strong>Query Options</strong></caption>                 <thead>          <tr>           <th>Key</th>           <th>Values</th>           <th>Description</th>          </tr>          </thead>          <tbody class="tbody">          <tr>           <td>QueryTimeout</td>           <td>A positive integer value.</td>           <td>Sets the query timeout in seconds. By default, the driver will            wait indefinitely for results.</td>          </tr>           <tr>           <td>SendStreamParamsAtExec</td>           <td><strong><span>TRUE</span></strong> or <strong><span>FALSE</span></strong> (the default is <strong><span>TRUE</span></strong>)</td>           <td>Configures the driver to send all stream data at execution (<strong><span>TRUE</span></strong>),            or to send stream data in chunks (<strong><span>FALSE</span></strong>). By default, the value is set            to <strong><span>TRUE</span></strong>. For more information, see <span class="function">{@link sqlsrv_send_stream_data()}</span>.</td>          </tr>           <tr>           <td>Scrollable</td>           <td>SQLSRV_CURSOR_FORWARD, SQLSRV_CURSOR_STATIC, SQLSRV_CURSOR_DYNAMIC,            or SQLSRV_CURSOR_KEYSET</td>           <td>See <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying            a Cursor Type and Selecting Rows</a> in the Microsoft SQLSRV documentation.</td>          </tr>          </tbody>               </table>       </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-query-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns a statement resource on success and <strong><span>FALSE</span></strong> if an error occurred.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-query-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2584">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_query()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"INSERT&nbsp;INTO&nbsp;Table_1&nbsp;(id,&nbsp;data)&nbsp;VALUES&nbsp;(?,&nbsp;?)"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$params&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #9876AA">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"some&nbsp;data"</span><span style="color: #007700">);<br /><br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$params</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>    <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 notes" id="refsect1-function.sqlsrv-query-notes">   <h3 class="title">注释</h3>   <p class="para">    For statements that you plan to execute only once, use <span class="function"><strong style="color:#CC7832">sqlsrv_query()</strong></span>.     If you intend to re-execute a statement with different parameter values, use     the combination of <span class="function">{@link sqlsrv_prepare()}</span> and <span class="function">{@link sqlsrv_execute()}</span>.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-query-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_prepare()} - Prepares a query for execution</span></li>     <li class="member"><span class="function">{@link sqlsrv_execute()} - Executes a statement prepared with sqlsrv_prepare</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return resource|bool A statement resource. If the statement cannot be created and/or executed, false is returned.*/
function sqlsrv_query($conn, $tsql, $params=array(), $options=array()){}

/**
*<div id="function.sqlsrv-fetch" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_fetch</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_fetch</span> &mdash; <span class="dc-title">Makes the next row in a result set available for reading</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-fetch-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">        <span class="type" style="color:#EAB766"><a href="http://php.net/manual/zh/language.pseudo-types.php#language.types.mixed" class="type mixed" style="color:#EAB766">mixed</a></span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_fetch</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">int</span> <span class="parameter" style="color:#2EACF9">$row</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">int</span> <span class="parameter" style="color:#2EACF9">$offset</span></span>   ]] )</div>    <p class="para rdfs-comment">    Makes the next row in a result set available for reading. Use     <span class="function">{@link sqlsrv_get_field()}</span> to read the fields of the row.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-fetch-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        A statement resource created by executing <span class="function">{@link sqlsrv_query()}</span>         or <span class="function">{@link sqlsrv_execute()}</span>.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">row</span></dt>       <dd>        <p class="para">        The row to be accessed. This parameter can only be used if the specified         statement was prepared with a scrollable cursor. In that case, this parameter         can take on one of the following values:        <ul class="simplelist">         <li class="member">SQLSRV_SCROLL_NEXT</li>         <li class="member">SQLSRV_SCROLL_PRIOR</li>         <li class="member">SQLSRV_SCROLL_FIRST</li>         <li class="member">SQLSRV_SCROLL_LAST</li>         <li class="member">SQLSRV_SCROLL_ABSOLUTE</li>         <li class="member">SQLSRV_SCROLL_RELATIVE</li>        </ul>       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">offset</span></dt>       <dd>        <p class="para">        Specifies the row to be accessed if the row parameter is set to        <strong><span>SQLSRV_SCROLL_ABSOLUTE</span></strong> or        <strong><span>SQLSRV_SCROLL_RELATIVE</span></strong>. Note that the first row in        a result set has index 0.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-fetch-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns <strong><span>TRUE</span></strong> if the next row of a result set was successfully retrieved,     <strong><span>FALSE</span></strong> if an error occurs, and <strong><span>NULL</span></strong> if there are no more rows in the result set.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-fetch-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2575">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_fetch()</strong></span> example</strong></p>     <div class="example-contents"><p>     The following example demonstrates how to retrieve a row with      <span class="function"><strong style="color:#CC7832">sqlsrv_fetch()</strong></span> and get the row fields with      <span class="function">{@link sqlsrv_get_field()}</span>.     </p></div>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;Name,&nbsp;Comment&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM&nbsp;Table_1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE&nbsp;ReviewID=1"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Make&nbsp;the&nbsp;first&nbsp;(and&nbsp;in&nbsp;this&nbsp;case,&nbsp;only)&nbsp;row&nbsp;of&nbsp;the&nbsp;result&nbsp;set&nbsp;available&nbsp;for&nbsp;reading.<br /></span><span style="color: #007700">if(&nbsp;</span><span style="color: #9876AA">sqlsrv_fetch</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #9876AA">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Get&nbsp;the&nbsp;row&nbsp;fields.&nbsp;Field&nbsp;indeces&nbsp;start&nbsp;at&nbsp;0&nbsp;and&nbsp;must&nbsp;be&nbsp;retrieved&nbsp;in&nbsp;order.<br />//&nbsp;Retrieving&nbsp;row&nbsp;fields&nbsp;by&nbsp;name&nbsp;is&nbsp;not&nbsp;supported&nbsp;by&nbsp;sqlsrv_get_field.<br /></span><span style="color: #9876AA">$name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_get_field</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">0</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #9876AA">$name</span><span style="color: #DD0000">:&nbsp;"</span><span style="color: #007700">;<br /><br /></span><span style="color: #9876AA">$comment&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_get_field</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">1</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #9876AA">$comment</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>      <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-fetch-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_get_field()} - Gets field data from the currently selected row</span></li>     <li class="member"><span class="function">{@link sqlsrv_fetch_array()} - Returns a row as an array</span></li>     <li class="member"><span class="function">{@link sqlsrv_fetch_object()} - Retrieves the next row of data in a result set as an object</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return array|null|false If the next row of the result set was successfully retrieved, true is returned. If there are*/
function sqlsrv_fetch($stmt, $row=null, $offset=null){}

/**
*<div id="function.sqlsrv-get-field" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_get_field</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_get_field</span> &mdash; <span class="dc-title">Gets field data from the currently selected row</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-get-field-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766"><a href="http://php.net/manual/zh/language.pseudo-types.php#language.types.mixed" class="type mixed" style="color:#EAB766">mixed</a></span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_get_field</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    , <span class="methodparam"><span class="type" style="color:#EAB766">int</span> <span class="parameter" style="color:#2EACF9">$fieldIndex</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">int</span> <span class="parameter" style="color:#2EACF9">$getAsType</span></span>   ] )</div>    <p class="para rdfs-comment">    Gets field data from the currently selected row. Fields must be accessed in     order. Field indices start at 0.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-get-field-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        A statement resource returned by <span class="function">{@link sqlsrv_query()}</span> or         <span class="function">{@link sqlsrv_execute()}</span>.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">fieldIndex</span></dt>       <dd>        <p class="para">        The index of the field to be retrieved. Field indices start at 0. Fields         must be accessed in order. i.e. If you access field index 1, then field         index 0 will not be available.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">getAsType</span></dt>       <dd>        <p class="para">        The PHP data type for the returned field data. If this parameter is not         set, the field data will be returned as its default PHP data type.        For information about default PHP data types, see         <a href="http://msdn.microsoft.com/en-us/library/cc296193.aspx" class="link external">&raquo;&nbsp;Default PHP Data Types</a>         in the Microsoft SQLSRV documentation.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-get-field-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns data from the specified field on success. Returns <strong><span>FALSE</span></strong> otherwise.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-get-field-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2578">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_get_field()</strong></span> example</strong></p>     <div class="example-contents"><p>     The following example demonstrates how to retrieve a row with      <span class="function">{@link sqlsrv_fetch()}</span> and get the row fields with      <span class="function"><strong style="color:#CC7832">sqlsrv_get_field()</strong></span>.     </p></div>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;Name,&nbsp;Comment&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FROM&nbsp;Table_1<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;WHERE&nbsp;ReviewID=1"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Make&nbsp;the&nbsp;first&nbsp;(and&nbsp;in&nbsp;this&nbsp;case,&nbsp;only)&nbsp;row&nbsp;of&nbsp;the&nbsp;result&nbsp;set&nbsp;available&nbsp;for&nbsp;reading.<br /></span><span style="color: #007700">if(&nbsp;</span><span style="color: #9876AA">sqlsrv_fetch</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #9876AA">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Get&nbsp;the&nbsp;row&nbsp;fields.&nbsp;Field&nbsp;indeces&nbsp;start&nbsp;at&nbsp;0&nbsp;and&nbsp;must&nbsp;be&nbsp;retrieved&nbsp;in&nbsp;order.<br />//&nbsp;Retrieving&nbsp;row&nbsp;fields&nbsp;by&nbsp;name&nbsp;is&nbsp;not&nbsp;supported&nbsp;by&nbsp;sqlsrv_get_field.<br /></span><span style="color: #9876AA">$name&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_get_field</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">0</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #9876AA">$name</span><span style="color: #DD0000">:&nbsp;"</span><span style="color: #007700">;<br /><br /></span><span style="color: #9876AA">$comment&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_get_field</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">1</span><span style="color: #007700">);<br />echo&nbsp;</span><span style="color: #9876AA">$comment</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-get-field-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_fetch()} - Makes the next row in a result set available for reading</span></li>     <li class="member"><span class="function">{@link sqlsrv_fetch_array()} - Returns a row as an array</span></li>     <li class="member"><span class="function">{@link sqlsrv_fetch_object()} - Retrieves the next row of data in a result set as an object</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return mixed The field data. You can specify the PHP data type of the returned data by using the $getAsType*/
function sqlsrv_get_field($stmt, $field_index, $get_as_type){}

/**
*<div id="function.sqlsrv-fetch-array" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_fetch_array</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_fetch_array</span> &mdash; <span class="dc-title">Returns a row as an array</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-fetch-array-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">array</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_fetch_array</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">int</span> <span class="parameter" style="color:#2EACF9">$fetchType</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">int</span> <span class="parameter" style="color:#2EACF9">$row</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">int</span> <span class="parameter" style="color:#2EACF9">$offset</span></span>   ]]] )</div>    <p class="para rdfs-comment">    Returns the next available row of data as an associative array, a numeric     array, or both (the default).   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-fetch-array-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        A statement resource returned by sqlsrv_query or sqlsrv_prepare.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">fetchType</span></dt>       <dd>        <p class="para">        A predefined constant specifying the type of array to return. Possible         values are <strong><span>SQLSRV_FETCH_ASSOC</span></strong>,         <strong><span>SQLSRV_FETCH_NUMERIC</span></strong>, and         <strong><span>SQLSRV_FETCH_BOTH</span></strong> (the default).       </p>       <p class="para">       A fetch type of SQLSRV_FETCH_ASSOC should not be used when consuming a        result set with multiple columns of the same name.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">row</span></dt>       <dd>        <p class="para">        Specifies the row to access in a result set that uses a scrollable cursor.         Possible values are <strong><span>SQLSRV_SCROLL_NEXT</span></strong>,         <strong><span>SQLSRV_SCROLL_PRIOR</span></strong>, <strong><span>SQLSRV_SCROLL_FIRST</span></strong>,         <strong><span>SQLSRV_SCROLL_LAST</span></strong>, <strong><span>SQLSRV_SCROLL_ABSOLUTE</span></strong> and,         <strong><span>SQLSRV_SCROLL_RELATIVE</span></strong> (the default). When this parameter         is specified, the <span class="parameter" style="color:#2EACF9">fetchType</span> must be explicitly defined.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">offset</span></dt>       <dd>        <p class="para">        Specifies the row to be accessed if the row parameter is set to        <strong><span>SQLSRV_SCROLL_ABSOLUTE</span></strong> or        <strong><span>SQLSRV_SCROLL_RELATIVE</span></strong>. Note that the first row in        a result set has index 0.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-fetch-array-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns an array on success, <strong><span>NULL</span></strong> if there are no more rows to return, and     <strong><span>FALSE</span></strong> if an error occurs.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-fetch-array-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2572">     <p><strong>Example #1 Retrieving an associative array.</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\instanceName"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;FirstName,&nbsp;LastName&nbsp;FROM&nbsp;SomeTable"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">)&nbsp;);<br />}<br /><br />while(&nbsp;</span><span style="color: #9876AA">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_fetch_array</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">SQLSRV_FETCH_ASSOC</span><span style="color: #007700">)&nbsp;)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #9876AA">$row</span><span style="color: #007700">[</span><span style="color: #DD0000">'LastName'</span><span style="color: #007700">].</span><span style="color: #DD0000">",&nbsp;"</span><span style="color: #007700">.</span><span style="color: #9876AA">$row</span><span style="color: #007700">[</span><span style="color: #DD0000">'FirstName'</span><span style="color: #007700">].</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #9876AA">sqlsrv_free_stmt</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>   <p class="para">    <div class="example" id="example-2573">     <p><strong>Example #2 Retrieving a numeric array.</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\instanceName"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;FirstName,&nbsp;LastName&nbsp;FROM&nbsp;SomeTable"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">)&nbsp;);<br />}<br /><br />while(&nbsp;</span><span style="color: #9876AA">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_fetch_array</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">SQLSRV_FETCH_NUMERIC</span><span style="color: #007700">)&nbsp;)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #9876AA">$row</span><span style="color: #007700">[</span><span style="color: #9876AA">0</span><span style="color: #007700">].</span><span style="color: #DD0000">",&nbsp;"</span><span style="color: #007700">.</span><span style="color: #9876AA">$row</span><span style="color: #007700">[</span><span style="color: #9876AA">1</span><span style="color: #007700">].</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #9876AA">sqlsrv_free_stmt</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </p>  </div>    <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 notes" id="refsect1-function.sqlsrv-fetch-array-notes">   <h3 class="title">注释</h3>   <p class="para">    Not specifying the <span class="parameter" style="color:#2EACF9">fetchType</span> or explicity using the     <strong><span>SQLSRV_FETCH_TYPE</span></strong> constant in the examples above will     return an array that has both associative and numeric keys.    </p>   <p class="para">    If more than one column is returned with the same name, the last column will     take precedence. To avoid field name collisions, use aliases.    </p>   <p class="para">   If a column with no name is returned, the associative key for the array element    will be an empty string (&quot;&quot;).   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-fetch-array-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_connect()} - Opens a connection to a Microsoft SQL Server database</span></li>     <li class="member"><span class="function">{@link sqlsrv_query()} - Prepares and executes a query</span></li>     <li class="member"><span class="function">{@link sqlsrv_errors()} - Returns error and warning information about the last SQLSRV operation performed</span></li>     <li class="member"><span class="function">{@link sqlsrv_fetch()} - Makes the next row in a result set available for reading</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return array|null|false If a row of data is retrieved, an array is returned. If there are no more rows to retrieve, null is returned. If an error occurs, false is returned.*/
function sqlsrv_fetch_array($stmt, $fetch_type = null, $row=null, $offset=null){}

/**
*<div id="function.sqlsrv-fetch-object" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_fetch_object</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_fetch_object</span> &mdash; <span class="dc-title">Retrieves the next row of data in a result set as an object</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-fetch-object-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766"><a href="http://php.net/manual/zh/language.pseudo-types.php#language.types.mixed" class="type mixed" style="color:#EAB766">mixed</a></span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_fetch_object</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">string</span> <span class="parameter" style="color:#2EACF9">$className</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">array</span> <span class="parameter" style="color:#2EACF9">$ctorParams</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">int</span> <span class="parameter" style="color:#2EACF9">$row</span></span>    [, <span class="methodparam"><span class="type" style="color:#EAB766">int</span> <span class="parameter" style="color:#2EACF9">$offset</span></span>   ]]]] )</div>    <p class="para rdfs-comment">    Retrieves the next row of data in a result set as an instance of the specified     class with properties that match the row field names and values that correspond     to the row field values.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-fetch-object-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        A statement resource created by <span class="function">{@link sqlsrv_query()}</span> or         <span class="function">{@link sqlsrv_execute()}</span>.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">className</span></dt>       <dd>        <p class="para">        The name of the class to instantiate. If no class name is specified,         stdClass is instantiated.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">ctorParams</span></dt>       <dd>        <p class="para">        Values passed to the constructor of the specified class. If the constructor         of the specified class takes parameters, the ctorParams array must be         supplied.       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">row</span></dt>       <dd>        <p class="para">        The row to be accessed. This parameter can only be used if the specified         statement was prepared with a scrollable cursor. In that case, this parameter         can take on one of the following values:        <ul class="simplelist">         <li class="member">SQLSRV_SCROLL_NEXT</li>         <li class="member">SQLSRV_SCROLL_PRIOR</li>         <li class="member">SQLSRV_SCROLL_FIRST</li>         <li class="member">SQLSRV_SCROLL_LAST</li>         <li class="member">SQLSRV_SCROLL_ABSOLUTE</li>         <li class="member">SQLSRV_SCROLL_RELATIVE</li>        </ul>       </p>      </dd>                 <dt> <span class="parameter" style="color:#2EACF9">offset</span></dt>       <dd>        <p class="para">        Specifies the row to be accessed if the row parameter is set to        <strong><span>SQLSRV_SCROLL_ABSOLUTE</span></strong> or        <strong><span>SQLSRV_SCROLL_RELATIVE</span></strong>. Note that the first row in        a result set has index 0.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-fetch-object-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">     Returns an object on success, <strong><span>NULL</span></strong> if there are no more rows to return,     and <strong><span>FALSE</span></strong> if an error occurs or if the specified class does not exist.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-fetch-object-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="sqlite3stmt.getsql.example.expanded">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_fetch_object()</strong></span> example</strong></p>     <div class="example-contents"><p>     The following example demonstrates how to retrieve a row as a stdClass object.     </p></div>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;fName,&nbsp;lName&nbsp;FROM&nbsp;Table_1"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//&nbsp;Retrieve&nbsp;each&nbsp;row&nbsp;as&nbsp;an&nbsp;object.<br />//&nbsp;Because&nbsp;no&nbsp;class&nbsp;is&nbsp;specified,&nbsp;each&nbsp;row&nbsp;will&nbsp;be&nbsp;retrieved&nbsp;as&nbsp;a&nbsp;stdClass&nbsp;object.<br />//&nbsp;Property&nbsp;names&nbsp;correspond&nbsp;to&nbsp;field&nbsp;names.<br /></span><span style="color: #007700">while(&nbsp;</span><span style="color: #9876AA">$obj&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_fetch_object</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #9876AA">$obj</span><span style="color: #007700">-&gt;</span><span style="color: #9876AA">fName</span><span style="color: #007700">.</span><span style="color: #DD0000">",&nbsp;"</span><span style="color: #007700">.</span><span style="color: #9876AA">$obj</span><span style="color: #007700">-&gt;</span><span style="color: #9876AA">lName</span><span style="color: #007700">.</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>    <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 notes" id="refsect1-function.sqlsrv-fetch-object-notes">   <h3 class="title">注释</h3>   <p class="para">    If a class name is specified with the optional $className parameter and the     class has properties whose names match the result set field names, the corresponding     result set values are applied to the properties. If a result set field name     does not match a class property, a property with the result set field name is added     to the object and the result set value is applied to the property. The following     rules apply when using the $className parameter:    <ul class="simplelist">       <li class="member">Field-property name matching is case-sensitive.</li>       <li class="member">Field-property matching occurs regardless of access modifiers.</li>       <li class="member">Class property data types are ignored when applying a field value to a property.</li>       <li class="member">If the class does not exist, the function returns <strong><span>FALSE</span></strong> and adds an error to the error collection.</li>    </ul>    Regardless of whether the $className parameter is supplied, if a field with no     name is returned, the field value will be ignored and a warning will be added     to the error collection.   </p>   <p class="para">    When consuming a result set that has multiple columns with the same name, it may     be better to use <span class="function">{@link sqlsrv_fetch_array()}</span> or the combination of     <span class="function">{@link sqlsrv_fetch()}</span> and <span class="function">{@link sqlsrv_get_field()}</span>.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-fetch-object-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_fetch()} - Makes the next row in a result set available for reading</span></li>     <li class="member"><span class="function">{@link sqlsrv_fetch_array()} - Returns a row as an array</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return object|false|null A PHP object with properties that correspond to result set field names. Property values are*/
function sqlsrv_fetch_object($stmt, $class_name=null, $ctor_params=null, $row=null, $offset=null){}

/**
*<div id="function.sqlsrv-has-rows" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_has_rows</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_has_rows</span> &mdash; <span class="dc-title">Indicates whether the specified statement has rows</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-has-rows-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">bool</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_has_rows</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    )</div>    <p class="para rdfs-comment">    Indicates whether the specified statement has rows.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-has-rows-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        A statement resource returned by <span class="function">{@link sqlsrv_query()}</span> or         <span class="function">{@link sqlsrv_execute()}</span>.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-has-rows-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns <strong><span>TRUE</span></strong> if the specified statement has rows and <strong><span>FALSE</span></strong> if the statement     does not have rows or if an error occurred.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-has-rows-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2579">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_has_rows()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$server&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"&nbsp;</span><span style="color: #007700">)<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$server</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">);<br /><br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;Table_1"</span><span style="color: #007700">);<br /><br />if&nbsp;(</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #9876AA">$rows&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_has_rows</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #9876AA">$rows&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"There&nbsp;are&nbsp;rows.&nbsp;&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;else&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"There&nbsp;are&nbsp;no&nbsp;rows.&nbsp;&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-has-rows-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_num_rows()} - Retrieves the number of rows in a result set</span></li>     <li class="member"><span class="function">{@link sqlsrv_query()} - Prepares and executes a query</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return bool If there are rows in the result set, the return value will be true. If there are no rows, or if the*/
function sqlsrv_has_rows($stmt){}

/**
*<div id="function.sqlsrv-num-fields" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_num_fields</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_num_fields</span> &mdash; <span class="dc-title">Retrieves the number of fields (columns) on a statement</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-num-fields-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766"><a href="http://php.net/manual/zh/language.pseudo-types.php#language.types.mixed" class="type mixed" style="color:#EAB766">mixed</a></span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_num_fields</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    )</div>    <p class="para rdfs-comment">    Retrieves the number of fields (columns) on a statement.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-num-fields-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        The statment for which the number of fields is returned.         <span class="function"><strong style="color:#CC7832">sqlsrv_num_fields()</strong></span> can be called on a statement before         or after statement execution.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-num-fields-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns the number of fields on success. Returns <strong><span>FALSE</span></strong> otherwise.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-num-fields-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2581">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_num_fields()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;Table_1"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$numFields&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_num_fields</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">);<br /><br />while(&nbsp;</span><span style="color: #9876AA">sqlsrv_fetch</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Iterate&nbsp;through&nbsp;the&nbsp;fields&nbsp;of&nbsp;each&nbsp;row.<br />&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">for(</span><span style="color: #9876AA">$i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">0</span><span style="color: #007700">;&nbsp;</span><span style="color: #9876AA">$i&nbsp;</span><span style="color: #007700">&lt;&nbsp;</span><span style="color: #9876AA">$numFields</span><span style="color: #007700">;&nbsp;</span><span style="color: #9876AA">$i</span><span style="color: #007700">++)&nbsp;{&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #9876AA">sqlsrv_get_field</span><span style="color: #007700">(</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$i</span><span style="color: #007700">).</span><span style="color: #DD0000">"&nbsp;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-num-fields-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_field_metadata()} - Retrieves metadata for the fields of a statement prepared by    sqlsrv_prepare or sqlsrv_query</span></li>     <li class="member"><span class="function">{@link sqlsrv_fetch()} - Makes the next row in a result set available for reading</span></li>     <li class="member"><span class="function">{@link sqlsrv_get_field()} - Gets field data from the currently selected row</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return int|bool An integer value that represents the number of fields in the active result set. If an error occurs,*/
function sqlsrv_num_fields($stmt){}

/**
*<div id="function.sqlsrv-next-result" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_next_result</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_next_result</span> &mdash; <span class="dc-title">Makes the next result of the specified statement active</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-next-result-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766"><a href="http://php.net/manual/zh/language.pseudo-types.php#language.types.mixed" class="type mixed" style="color:#EAB766">mixed</a></span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_next_result</strong></span>         ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    )</div>    <p class="para rdfs-comment">    Makes the next result of the specified statement active. Results include result     sets, row counts, and output parameters.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-next-result-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        The statment on which the next result is being called.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-next-result-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns <strong><span>TRUE</span></strong> if the next result was successfully retrieved, <strong><span>FALSE</span></strong> if an error     occurred, and <strong><span>NULL</span></strong> if there are no more results to retrieve.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-next-result-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2580">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_next_result()</strong></span> example</strong></p>     <div class="example-contents"><p>     The following example executes a batch query that inserts into a table and      then selects from the table. This produces two results on the statement:      one for the rows affected by the INSERT and one for the rows returned by      the SELECT. To get to the rows returned by the SELECT,      <span class="function"><strong style="color:#CC7832">sqlsrv_next_result()</strong></span> must be called to move past the first result.     </p></div>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"userName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br /><br /></span><span style="color: #9876AA">$query&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"INSERT&nbsp;INTO&nbsp;Table_1&nbsp;(id,&nbsp;data)&nbsp;VALUES&nbsp;(?,?);&nbsp;SELECT&nbsp;*&nbsp;FROM&nbsp;TABLE_1;"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$params&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #9876AA">1</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"some&nbsp;data"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$query</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$params</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Consume&nbsp;the&nbsp;first&nbsp;result&nbsp;(rows&nbsp;affected&nbsp;by&nbsp;INSERT)&nbsp;without&nbsp;calling&nbsp;sqlsrv_next_result.<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #DD0000">"Rows&nbsp;affected:&nbsp;"</span><span style="color: #007700">.</span><span style="color: #9876AA">sqlsrv_rows_affected</span><span style="color: #007700">(</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">).</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;Move&nbsp;to&nbsp;the&nbsp;next&nbsp;result&nbsp;and&nbsp;display&nbsp;results.<br /></span><span style="color: #9876AA">$next_result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_next_result</span><span style="color: #007700">(</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$next_result&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;while(&nbsp;</span><span style="color: #9876AA">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_fetch_array</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">SQLSRV_FETCH_ASSOC</span><span style="color: #007700">)){<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #9876AA">$row</span><span style="color: #007700">[</span><span style="color: #DD0000">'id'</span><span style="color: #007700">].</span><span style="color: #DD0000">":&nbsp;"</span><span style="color: #007700">.</span><span style="color: #9876AA">$row</span><span style="color: #007700">[</span><span style="color: #DD0000">'data'</span><span style="color: #007700">].</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;&nbsp;<br />&nbsp;&nbsp;&nbsp;}<br />}&nbsp;elseif(&nbsp;</span><span style="color: #9876AA">is_null</span><span style="color: #007700">(</span><span style="color: #9876AA">$next_result</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"No&nbsp;more&nbsp;results.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-next-result-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_query()} - Prepares and executes a query</span></li>     <li class="member"><span class="function">{@link sqlsrv_fetch_array()} - Returns a row as an array</span></li>     <li class="member"><span class="function">{@link sqlsrv_rows_affected()} - Returns the number of rows modified by the last INSERT, UPDATE, or    DELETE query executed</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return bool|null If the next result was successfully made active, the Boolean value true is returned. If an error occurred in*/
function sqlsrv_next_result($stmt){}

/**
*<div id="function.sqlsrv-num-rows" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_num_rows</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_num_rows</span> &mdash; <span class="dc-title">Retrieves the number of rows in a result set</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-num-rows-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766"><a href="http://php.net/manual/zh/language.pseudo-types.php#language.types.mixed" class="type mixed" style="color:#EAB766">mixed</a></span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_num_rows</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    )</div>    <p class="para rdfs-comment">    Retrieves the number of rows in a result set. This function requires that the     statment resource be created with a static or keyset cursor. For more information,     see <span class="function">{@link sqlsrv_query()}</span>, <span class="function">{@link sqlsrv_prepare()}</span>,     or <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>     in the Microsoft SQLSRV documentation.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-num-rows-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        The statement for which the row count is returned. The statment resource         must be created with a static or keyset cursor. For more information, see         <span class="function">{@link sqlsrv_query()}</span>, <span class="function">{@link sqlsrv_prepare()}</span>, or         <a href="http://msdn.microsoft.com/en-us/library/ee376927.aspx" class="link external">&raquo;&nbsp;Specifying a Cursor Type and Selecting Rows</a>         in the Microsoft SQLSRV documentation.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-num-rows-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns the number of rows retrieved on success and <strong><span>FALSE</span></strong> if an error occurred.     If a forward cursor (the default) or dynamic cursor is used, <strong><span>FALSE</span></strong> is returned.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-num-rows-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2582">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_num_rows()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$server&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$server</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">);<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;Table_1"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$params&nbsp;</span><span style="color: #007700">=&nbsp;array();<br /></span><span style="color: #9876AA">$options&nbsp;</span><span style="color: #007700">=&nbsp;&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Scrollable"&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #9876AA">SQLSRV_CURSOR_KEYSET&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$params</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$options&nbsp;</span><span style="color: #007700">);<br /><br /></span><span style="color: #9876AA">$row_count&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_num_rows</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;<br />if&nbsp;(</span><span style="color: #9876AA">$row_count&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Error&nbsp;in&nbsp;retrieveing&nbsp;row&nbsp;count."</span><span style="color: #007700">;<br />else<br />&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #9876AA">$row_count</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-num-rows-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_has_rows()} - Indicates whether the specified statement has rows</span></li>     <li class="member"><span class="function">{@link sqlsrv_rows_affected()} - Returns the number of rows modified by the last INSERT, UPDATE, or    DELETE query executed</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return int|bool False if there was an error calculating the number of rows. Otherwise, returns the number of rows in the result set.*/
function sqlsrv_num_rows($stmt){}

/**
*<div id="function.sqlsrv-rows-affected" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_rows_affected</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_rows_affected</span> &mdash; <span class="dc-title">Returns the number of rows modified by the last INSERT, UPDATE, or    DELETE query executed</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-rows-affected-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">int</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_rows_affected</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    )</div>    <p class="para rdfs-comment">    Returns the number of rows modified by the last INSERT, UPDATE, or DELETE     query executed. For information about the number of rows returned by a SELECT     query, see <span class="function">{@link sqlsrv_num_rows()}</span>.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-rows-affected-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        The executed statement resource for which the number of affected rows is returned.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-rows-affected-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns the number of rows affected by the last INSERT, UPDATE, or DELETE query.     If no rows were affected, 0 is returned. If the number of affected rows cannot     be determined, -1 is returned. If an error occurred, <strong><span>FALSE</span></strong> is returned.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-rows-affected-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2586">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_rows_affected()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"UPDATE&nbsp;Table_1&nbsp;SET&nbsp;data&nbsp;=&nbsp;?&nbsp;WHERE&nbsp;id&nbsp;=&nbsp;?"</span><span style="color: #007700">;<br /><br /></span><span style="color: #9876AA">$params&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">"updated&nbsp;data"</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">1</span><span style="color: #007700">);<br /><br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$params</span><span style="color: #007700">);<br /><br /></span><span style="color: #9876AA">$rows_affected&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_rows_affected</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$rows_affected&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}&nbsp;elseif(&nbsp;</span><span style="color: #9876AA">$rows_affected&nbsp;</span><span style="color: #007700">==&nbsp;-</span><span style="color: #9876AA">1</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"No&nbsp;information&nbsp;available.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #9876AA">$rows_affected</span><span style="color: #007700">.</span><span style="color: #DD0000">"&nbsp;rows&nbsp;were&nbsp;updated.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-rows-affected-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_num_rows()} - Retrieves the number of rows in a result set</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return int|bool An integer indicating the number of rows modified by the last executed statement. If no rows were*/
function sqlsrv_rows_affected($stmt){}

/**
*<div id="function.sqlsrv-client-info" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_client_info</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_client_info</span> &mdash; <span class="dc-title">Returns information about the client and specified connection</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-client-info-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">array</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_client_info</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$conn</span></span>    )</div>    <p class="para rdfs-comment">    Returns information about the client and specified connection   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-client-info-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">conn</span></dt>       <dd>        <p class="para">        The connection about which information is returned.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-client-info-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns an associative array with keys described in the table below.     Returns <strong><span>FALSE</span></strong> otherwise.     <table class="doctable table">    <caption><strong>Array returned by sqlsrv_client_info</strong></caption>         <thead>      <tr>       <th>Key</th>       <th>Description</th>      </tr>      </thead>      <tbody class="tbody">      <tr>       <td>DriverDllName</td>       <td>SQLNCLI10.DLL</td>      </tr>       <tr>       <td>DriverODBCVer</td>       <td>ODBC version (xx.yy)</td>      </tr>       <tr>       <td>DriverVer</td>       <td>SQL Server Native Client DLL version (10.5.xxx)</td>      </tr>       <tr>       <td>ExtensionVer</td>       <td>php_sqlsrv.dll version (2.0.xxx.x)</td>      </tr>      </tbody>       </table>    </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-client-info-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2564">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_client_info()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connOptions&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connOptions&nbsp;</span><span style="color: #007700">);<br /><br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br />if(&nbsp;</span><span style="color: #9876AA">$client_info&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_client_info</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(&nbsp;</span><span style="color: #9876AA">$client_info&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #9876AA">$key&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #9876AA">$value</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #9876AA">$key</span><span style="color: #007700">.</span><span style="color: #DD0000">":&nbsp;"</span><span style="color: #007700">.</span><span style="color: #9876AA">$value</span><span style="color: #007700">.</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"Error&nbsp;in&nbsp;retrieving&nbsp;client&nbsp;info.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-client-info-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_server_info()} - Returns information about the server</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return array|null An associative array with keys described in the table below, or false if the connection resource*/
function sqlsrv_client_info($conn){}

/**
*<div id="function.sqlsrv-server-info" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_server_info</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_server_info</span> &mdash; <span class="dc-title">Returns information about the server</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-server-info-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">array</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_server_info</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$conn</span></span>    )</div>    <p class="para rdfs-comment">    Returns information about the server.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-server-info-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">conn</span></dt>       <dd>        <p class="para">        The connection resource that connects the client and the server.       </p>      </dd>          </dl>    </span>  </div>    <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-server-info-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns an array as described in the following table:   <table class="doctable table">   <caption><strong>Returned Array</strong></caption>         <thead>      <tr>       <th>CurrentDatabase</th>       <th>The connected-to database.</th>      </tr>      </thead>      <tbody class="tbody">      <tr>       <td>SQLServerVersion</td>       <td>The SQL Server version.</td>      </tr>       <tr>       <td>SQLServerName</td>       <td>The name of the server.</td>      </tr>      </tbody>       </table>   </p>  </div>    <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-server-info-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2588">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_server_info()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$server_info&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_server_info</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$server_info&nbsp;</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(&nbsp;</span><span style="color: #9876AA">$server_info&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #9876AA">$key&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #9876AA">$value</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #9876AA">$key</span><span style="color: #007700">.</span><span style="color: #DD0000">":&nbsp;"</span><span style="color: #007700">.</span><span style="color: #9876AA">$value</span><span style="color: #007700">.</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-server-info-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_client_info()} - Returns information about the client and specified connection</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return array An associative array with the following keys:*/
function sqlsrv_server_info($conn){}

/**
*<div id="function.sqlsrv-cancel" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_cancel</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_cancel</span> &mdash; <span class="dc-title">Cancels a statement</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-cancel-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">bool</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_cancel</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    )</div>    <p class="para rdfs-comment">    Cancels a statement. Any results associated with the statement that have not     been consumed are deleted. After <span class="function"><strong style="color:#CC7832">sqlsrv_cancel()</strong></span> has been     called, the specified statement can be re-executed if it was created with     <span class="function">{@link sqlsrv_prepare()}</span>. Calling <span class="function"><strong style="color:#CC7832">sqlsrv_cancel()</strong></span>     is not necessary if all the results associated with the statement have been     consumed.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-cancel-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        The statement resource to be cancelled.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-cancel-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    成功时返回 <strong><span>TRUE</span></strong>， 或者在失败时返回 <strong><span>FALSE</span></strong>。   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-cancel-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2563">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_cancel()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;Sales&nbsp;FROM&nbsp;Table_1"</span><span style="color: #007700">;<br /><br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_prepare</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql</span><span style="color: #007700">);<br /><br />if(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br />if(&nbsp;</span><span style="color: #9876AA">sqlsrv_execute</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">)&nbsp;===&nbsp;</span><span style="color: #9876AA">false</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$salesTotal&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">0</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$count&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">0</span><span style="color: #007700">;<br /><br />while(&nbsp;(</span><span style="color: #9876AA">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_fetch_array</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">))&nbsp;&amp;&amp;&nbsp;</span><span style="color: #9876AA">$salesTotal&nbsp;</span><span style="color: #007700">&lt;=</span><span style="color: #9876AA">100000</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #9876AA">$qty&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">$row</span><span style="color: #007700">[</span><span style="color: #9876AA">0</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #9876AA">$price&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">$row</span><span style="color: #007700">[</span><span style="color: #9876AA">1</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #9876AA">$salesTotal&nbsp;</span><span style="color: #007700">+=&nbsp;(&nbsp;</span><span style="color: #9876AA">$price&nbsp;</span><span style="color: #007700">*&nbsp;</span><span style="color: #9876AA">$qty</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #9876AA">$count</span><span style="color: #007700">++;<br />}<br /><br />echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #9876AA">$count</span><span style="color: #DD0000">&nbsp;sales&nbsp;accounted&nbsp;for&nbsp;the&nbsp;first&nbsp;$</span><span style="color: #9876AA">$salesTotal</span><span style="color: #DD0000">&nbsp;in&nbsp;revenue.&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;Cancel&nbsp;the&nbsp;pending&nbsp;results.&nbsp;The&nbsp;statement&nbsp;can&nbsp;be&nbsp;reused.<br /></span><span style="color: #9876AA">sqlsrv_cancel</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>    <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 notes" id="refsect1-function.sqlsrv-cancel-notes">   <h3 class="title">注释</h3>   <p class="para">    The main difference between <span class="function"><strong style="color:#CC7832">sqlsrv_cancel()</strong></span> and     <span class="function">{@link sqlsrv_free_stmt()}</span> is that a statement resource cancelled with     <span class="function"><strong style="color:#CC7832">sqlsrv_cancel()</strong></span> can be re-executed if it was created with     <span class="function">{@link sqlsrv_prepare()}</span>. A statement resource cancelled with     <span class="function"><strong style="color:#CC7832">sqlsrv_free_statement()</strong></span> cannot be re-executed.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-cancel-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_free_stmt()} - Frees all resources for the specified statement</span></li>     <li class="member"><span class="function">{@link sqlsrv_prepare()} - Prepares a query for execution</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return bool A Boolean value: true if the operation was successful. Otherwise, false.*/
function sqlsrv_cancel($stmt){}

/**
*<div id="function.sqlsrv-free-stmt" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_free_stmt</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_free_stmt</span> &mdash; <span class="dc-title">Frees all resources for the specified statement</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-free-stmt-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">bool</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_free_stmt</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    )</div>    <p class="para rdfs-comment">    Frees all resources for the specified statement. The statement cannot be used     after <span class="function"><strong style="color:#CC7832">sqlsrv_free_stmt()</strong></span> has been called on it. If     <span class="function"><strong style="color:#CC7832">sqlsrv_free_stmt()</strong></span> is called on an in-progress statement     that alters server state, statement execution is terminated and the statement     is rolled back.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-free-stmt-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        The statment for which resources are freed.         Note that <strong><span>NULL</span></strong> is a valid parameter value. This allows the function to be         called multiple times in a script.        </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-free-stmt-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    成功时返回 <strong><span>TRUE</span></strong>， 或者在失败时返回 <strong><span>FALSE</span></strong>。   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-free-stmt-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2577">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_free_stmt()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_query</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;Table_1"</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #FF8000">//-------------------------------<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Process&nbsp;query&nbsp;results&nbsp;here.<br />-------------------------------<br /><br />//&nbsp;Free&nbsp;the&nbsp;statement&nbsp;resources.&nbsp;<br /></span><span style="color: #9876AA">sqlsrv_free_stmt</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">);<br /><br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>      <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 notes" id="refsect1-function.sqlsrv-free-stmt-notes">   <h3 class="title">注释</h3>   <p class="para">    The main difference between <span class="function"><strong style="color:#CC7832">sqlsrv_free_stmt()</strong></span> and     <span class="function">{@link sqlsrv_cancel()}</span> is that a statement resource cancelled with     <span class="function">{@link sqlsrv_cancel()}</span> can be re-executed if it was created with     <span class="function">{@link sqlsrv_prepare()}</span>. A statement resource cancelled with     <span class="function"><strong style="color:#CC7832">sqlsrv_free_statement()</strong></span> cannot be re-executed.   </p>  </div>   <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-free-stmt-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_cancel()} - Cancels a statement</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return bool The Boolean value true unless the function is called with an invalid parameter. If the function is*/
function sqlsrv_free_stmt($stmt){}

/**
*<div id="function.sqlsrv-field-metadata" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_field_metadata</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_field_metadata</span> &mdash; <span class="dc-title">Retrieves metadata for the fields of a statement prepared by    <span class="function">{@link sqlsrv_prepare()}</span> or <span class="function">{@link sqlsrv_query()}</span>   </span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-field-metadata-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766"><a href="http://php.net/manual/zh/language.pseudo-types.php#language.types.mixed" class="type mixed" style="color:#EAB766">mixed</a></span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_field_metadata</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    )</div>    <p class="para rdfs-comment">    Retrieves metadata for the fields of a statement prepared by     <span class="function">{@link sqlsrv_prepare()}</span> or <span class="function">{@link sqlsrv_query()}</span>.     <span class="function"><strong style="color:#CC7832">sqlsrv_field_metadata()</strong></span> can be called on a statement before     or after statement execution.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-field-metadata-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        The statment resource for which metadata is returned.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-field-metadata-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns an array of arrays on success. Otherwise, <strong><span>FALSE</span></strong> is returned.     Each returned array is described by the following table:    <table class="doctable table">    <caption><strong>Array returned by sqlsrv_field_metadata</strong></caption>         <thead>      <tr>       <th>Key</th>       <th>Description</th>      </tr>      </thead>      <tbody class="tbody">      <tr>       <td>Name</td>       <td>The name of the field.</td>      </tr>       <tr>       <td>Type</td>       <td>The numeric value for the SQL type.</td>      </tr>       <tr>       <td>Size</td>       <td>The number of characters for fields of character type, the number of        bytes for fields of binary type, or <strong><span>NULL</span></strong> for other types.</td>      </tr>       <tr>       <td>Precision</td>       <td>The precision for types of variable precision, <strong><span>NULL</span></strong> for other types.</td>      </tr>       <tr>       <td>Scale</td>       <td>The scale for types of variable scale, <strong><span>NULL</span></strong> for other types.</td>      </tr>       <tr>       <td>Nullable</td>       <td>An enumeration indicating whether the column is nullable, not nullable,        or if it is not known.</td>      </tr>      </tbody>       </table>    For more information, see <a href="http://msdn.microsoft.com/en-us/library/cc296197.aspx" class="link external">&raquo;&nbsp;sqlsrv_field_metadata</a>    in the Microsoft SQLSRV documentation.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-field-metadata-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2576">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_field_metadata()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"AdventureWorks"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"SELECT&nbsp;*&nbsp;FROM&nbsp;Table_1"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_prepare</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">);<br /><br />foreach(&nbsp;</span><span style="color: #9876AA">sqlsrv_field_metadata</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">)&nbsp;as&nbsp;</span><span style="color: #9876AA">$fieldMetadata&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(&nbsp;</span><span style="color: #9876AA">$fieldMetadata&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #9876AA">$name&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #9876AA">$value</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #9876AA">$name</span><span style="color: #DD0000">:&nbsp;</span><span style="color: #9876AA">$value</span><span style="color: #DD0000">&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">"&lt;br&nbsp;/&gt;"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-field-metadata-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_client_info()} - Returns information about the client and specified connection</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return array|bool An array of arrays or false. The array consists of one array for each field in the result set.*/
function sqlsrv_field_metadata($stmt){}

/**
*<div id="function.sqlsrv-send-stream-data" class="refentry">  <div class="refnamediv">   <h1 class="refname">sqlsrv_send_stream_data</h1>   <p class="verinfo">(No version information available, might only be in Git)</p><p class="refpurpose"><span class="refname">sqlsrv_send_stream_data</span> &mdash; <span class="dc-title">Sends data from parameter streams to the server</span></p>   </div>  <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 description" id="refsect1-function.sqlsrv-send-stream-data-description">   <h3 class="title">说明</h3>   <div class="methodsynopsis dc-description" style="border:1px gray;padding-left:5px;background:#232525">    <span class="type" style="color:#EAB766">bool</span> <span class="methodname" style="color:#CC7832"><strong>sqlsrv_send_stream_data</strong></span>     ( <span class="methodparam"><span class="type" style="color:#EAB766">resource</span> <span class="parameter" style="color:#2EACF9">$stmt</span></span>    )</div>    <p class="para rdfs-comment">    Send data from parameter streams to the server. Up to 8 KB of data is sent     with each call.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 parameters" id="refsect1-function.sqlsrv-send-stream-data-parameters">   <h3 class="title">参数</h3>   <span>    <dl>            <dt> <span class="parameter" style="color:#2EACF9">stmt</span></dt>       <dd>        <p class="para">        A statement resource returned by <span class="function">{@link sqlsrv_query()}</span> or         <span class="function">{@link sqlsrv_execute()}</span>.       </p>      </dd>          </dl>    </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 returnvalues" id="refsect1-function.sqlsrv-send-stream-data-returnvalues">   <h3 class="title">返回值</h3>   <p class="para">    Returns <strong><span>TRUE</span></strong> if there is more data to send and <strong><span>FALSE</span></strong> if there is not.   </p>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 examples" id="refsect1-function.sqlsrv-send-stream-data-examples">   <h3 class="title">范例</h3>   <span>    <div class="example" id="example-2587">     <p><strong>Example #1 <span class="function"><strong style="color:#CC7832">sqlsrv_send_stream_data()</strong></span> example</strong></p>     <div class="example-contents"> <div class="phpcode" style="border-color:gray;background:#232525"><span><span style="color: #000000"> <span style="color: #9876AA">&lt;?php<br />$serverName&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"serverName\sqlexpress"</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">$connectionInfo&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"Database"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"dbName"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"UID"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"username"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"PWD"</span><span style="color: #007700">=&gt;</span><span style="color: #DD0000">"password"&nbsp;</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_connect</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$serverName</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$connectionInfo</span><span style="color: #007700">);<br />if(&nbsp;</span><span style="color: #9876AA">$conn&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #9876AA">false&nbsp;</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;die(&nbsp;</span><span style="color: #9876AA">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">sqlsrv_errors</span><span style="color: #007700">(),&nbsp;</span><span style="color: #9876AA">true</span><span style="color: #007700">));<br />}<br /><br /></span><span style="color: #9876AA">$sql&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"UPDATE&nbsp;Table_1&nbsp;SET&nbsp;data&nbsp;=&nbsp;(&nbsp;?)&nbsp;WHERE&nbsp;id&nbsp;=&nbsp;100"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;Open&nbsp;parameter&nbsp;data&nbsp;as&nbsp;a&nbsp;stream&nbsp;and&nbsp;put&nbsp;it&nbsp;in&nbsp;the&nbsp;$params&nbsp;array.<br /></span><span style="color: #9876AA">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">fopen</span><span style="color: #007700">(&nbsp;</span><span style="color: #DD0000">"data://text/plain,[&nbsp;Lengthy&nbsp;content&nbsp;here.&nbsp;]"</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"r"</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$params&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;&amp;</span><span style="color: #9876AA">$data</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Prepare&nbsp;the&nbsp;statement.&nbsp;Use&nbsp;the&nbsp;$options&nbsp;array&nbsp;to&nbsp;turn&nbsp;off&nbsp;the<br />//&nbsp;default&nbsp;behavior,&nbsp;which&nbsp;is&nbsp;to&nbsp;send&nbsp;all&nbsp;stream&nbsp;data&nbsp;at&nbsp;the&nbsp;time&nbsp;of&nbsp;query<br />//&nbsp;execution.<br /></span><span style="color: #9876AA">$options&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">"SendStreamParamsAtExec"</span><span style="color: #007700">=&gt;</span><span style="color: #9876AA">0</span><span style="color: #007700">);<br /></span><span style="color: #9876AA">$stmt&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">sqlsrv_prepare</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$conn</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$sql</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$params</span><span style="color: #007700">,&nbsp;</span><span style="color: #9876AA">$options</span><span style="color: #007700">);<br /><br /></span><span style="color: #9876AA">sqlsrv_execute</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">//&nbsp;Send&nbsp;up&nbsp;to&nbsp;8K&nbsp;of&nbsp;parameter&nbsp;data&nbsp;to&nbsp;the&nbsp;server&nbsp;<br />//&nbsp;with&nbsp;each&nbsp;call&nbsp;to&nbsp;sqlsrv_send_stream_data.<br /></span><span style="color: #9876AA">$i&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #9876AA">1</span><span style="color: #007700">;<br />while(&nbsp;</span><span style="color: #9876AA">sqlsrv_send_stream_data</span><span style="color: #007700">(&nbsp;</span><span style="color: #9876AA">$stmt</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #9876AA">$i</span><span style="color: #007700">++;<br />}<br />echo&nbsp;</span><span style="color: #DD0000">"</span><span style="color: #9876AA">$i</span><span style="color: #DD0000">&nbsp;calls&nbsp;were&nbsp;made."</span><span style="color: #007700">;<br /></span><span style="color: #9876AA">?&gt;</span> </span> </span></div>     </div>     </div>   </span>  </div>     <br></br><div style="BORDER-TOP: gray 1px dashed; OVERFLOW: hidden; HEIGHT: 1px"></div><div class="refsect1 seealso" id="refsect1-function.sqlsrv-send-stream-data-seealso">   <h3 class="title">参见</h3>   <span>    <ul class="simplelist">     <li class="member"><span class="function">{@link sqlsrv_prepare()} - Prepares a query for execution</span></li>     <li class="member"><span class="function">{@link sqlsrv_query()} - Prepares and executes a query</span></li>    </ul>   </span>  </div>  <div class="up"><a href="http://php.net/manual/zh/ref.sqlsrv.php">SQLSRV 函数</a></div></div>
 * @return bool Boolean : true if there is more data to be sent. Otherwise, false.*/
function sqlsrv_send_stream_data($stmt){}

/**
 * Specifies the encoding of a stream of data from the server.
 *
 * <br />When specifying the PHP data type of a value being returned from the server, this allows you to specify the encoding
 * used to process the value if the value is a stream.<br />
 *
 * In the documentation this is presented as a constant that accepts an arguement.<br />
 *
 * When you use SQLSRV_PHPTYPE_STREAM, the encoding must be specified. If no parameter is supplied, an error will be
 * returned.<br />
 *
 * Additional Information at:
 * <ul>
 * <li>{@link http://msdn.microsoft.com/en-us/library/cc296208.aspx How to: Specify PHP Data Types}</li></li>
 * <li>{@link http://msdn.microsoft.com/en-us/library/cc296163.aspx How to: Retrieve Character Data as a Stream Using the SQLSRV Driver.}</li>
 * <li>{@link http://msdn.microsoft.com/en-us/library/cc626307.aspx How to: Send and Retrieve UTF-8 Data Using Built-In UTF-8 Support.}</li>
 * <li>{@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}</li></ui>
 *
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 * @param string $encoding The encoding to use for the stream. The valid options are SQLSRV_ENC_BINARY, SQLSRV_ENC_CHAR
 * or "UTF-8".
 * @return int Value to use in any place that accepts a SQLSRV_PHPTYPE_* constant to represent a PHP stream with the
 * given encoding.
 */
function SQLSRV_PHPTYPE_STREAM($encoding){}

/**
 * Specifies the encoding of a string being received form the server.
 *
 * <br />When specifying the PHP data type of a value being returned from the server, this allows you to specify the
 * encoding used to process the value if the value is a string.<br />
 *
 * In the documentation this is presented as a constant that accepts an arguement.<br />
 *
 * When you use SQLSRV_PHPTYPE_STRING, the encoding must be specified. If no parameter is supplied, an error will be
 * returned.<br />
 *
 * Additional Information at:
 * <ul>
 * <li>{@link http://msdn.microsoft.com/en-us/library/cc296208.aspx How to: Specify PHP Data Types}</li></li>
 * <li>{@link http://msdn.microsoft.com/en-us/library/cc296163.aspx How to: Retrieve Character Data as a Stream Using the SQLSRV Driver.}</li>
 * <li>{@link http://msdn.microsoft.com/en-us/library/cc626307.aspx How to: Send and Retrieve UTF-8 Data Using Built-In UTF-8 Support.}</li>
 * <li>{@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}</li></ui>
 *
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 * @param string $encoding The encoding to use for the stream. The valid options are SQLSRV_ENC_BINARY, SQLSRV_ENC_CHAR
 * or "UTF-8".
 * @return int Value to use in any place that accepts a SQLSRV_PHPTYPE_* constant to represent a PHP string with the
 * given encoding.
 */
function SQLSRV_PHPTYPE_STRING($encoding){}

/**
 * Specifies a SQL Server binary field.
 *
 * <br />In the documentation this is presented as a constant that accepts an arguement.<br />
 *
 * Additional Information at {@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}<br />
 *
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 * @param int $byteCount Must be between 1 and 8000.
 * @return int Value to use in any place that accepts a SQLSRV_SQLTYPE_* constant to represent the 'binary' data type.
 */
function SQLSRV_SQLTYPE_BINARY($byteCount){}

/**
 * Specifies a SQL Server varbinary field.
 *
 * <br />In the documentation this is presented as a constant that accepts an arguement.<br />
 *
 * Additional Information at {@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}<br />
 *
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 * @param int $byteCount Must be between 1 and 8000.
 * @return int Value to use in any place that accepts a SQLSRV_SQLTYPE_* constant to represent the varbinary data type.
 */
function SQLSRV_SQLTYPE_VARBINARY($byteCount){}

/**
 * Specifies a SQL Server varchar filed.
 *
 * <br />In the documentation this is presented as a constant that accepts an arguement.<br />
 *
 * Additional Information at {@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}<br />
 *
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 *
 * @param int $charCount Must be between 1 and 8000.
 *
 * @return int Value to use in any place that accepts a SQLSRV_SQLTYPE_* constant to represent the varchar data type.
 */

function SQLSRV_SQLTYPE_VARCHAR($charCount) {}

/**
 * Specifies a SQL Server char field.
 *
 * <br />In the documentation this is presented as a constant that accepts an arguement.<br />
 *
 * Additional Information at {@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}<br />
 *
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 * @param int $charCount Must be between 1 and 8000.
 * @return int Value to use in any place that accepts a SQLSRV_SQLTYPE_* constant to represent the char data type.
 */
function SQLSRV_SQLTYPE_CHAR($charCount){}

/**
 * Specifies a SQL Server nchar field.
 *
 * <br />In the documentation this is presented as a constant that accepts an arguement.<br />
 *
 * Additional Information at {@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}<br />
 *
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 * @param int $charCount Must be between 1 and 4000.
 * @return int Value to use in any place that accepts a SQLSRV_SQLTYPE_* constant to represent the nchar data type.
 */
function SQLSRV_SQLTYPE_NCHAR($charCount){}

/**
 * Specifies a SQL Server nvarchar field.
 *
 * <br />In the documentation this is presented as a constant that accepts an arguement.<br />
 *
 * Additional Information at {@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}<br />
 *
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 * @param int $charCount Must be between 1 and 4000.
 * @return int Value to use in any place that accepts a SQLSRV_SQLTYPE_* constant to represent the nvarchar data type.
 */
function SQLSRV_SQLTYPE_NVARCHAR($charCount){}

/**
 * Specifies a SQL Server decimal field.
 *
 * <br />In the documentation this is presented as a constant that accepts an arguement.<br />
 *
 * Additional Information at {@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}<br />
 *
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 * @param int $precision Must be between 1 and 38.
 * @param int $scale Must be between 1 and $precision.
 * @return int Value to use in any place that accepts a SQLSRV_SQLTYPE_* constant to represent the decimal data type.
 */
function SQLSRV_SQLTYPE_DECIMAL($precision, $scale){}

/**
 * Specifies a SQL Server numeric field.
 *
 * <br />In the documentation this is presented as a constant that accepts an arguement.<br />
 *
 * Additional Information at {@link http://msdn.microsoft.com/en-us/library/cc296152.aspx SQLSRV Driver API Reference}<br />
 *
 * @link http://msdn.microsoft.com/en-us/library/cc296183.aspx
 * @param int $precision Must be between 1 and 38.
 * @param int $scale Must be between 1 and $precision.
 * @return int Value to use in any place that accepts a SQLSRV_SQLTYPE_* constant to represent the numeric data type.
 */
function SQLSRV_SQLTYPE_NUMERIC($precision, $scale){}

